I've finally gone on around the bend, I guess... I'm not seeing why the
script below <./t2> doesn't show the value of $mode when fed by
the ls cmd shown:

(first, to shows whats here)

   ls -l *[eo2]
  -rw-r--r--+ 1 reader reader   5 Mar 16 15:26 one
  -rwxr-xr-x+ 1 reader reader 141 Mar 16 16:19 t2
  -rw-r--r--+ 1 reader reader   5 Mar 16 15:26 three
  -rw-r--r--+ 1 reader reader   5 Mar 16 15:26 two


  ls *[eo2] | ./t2
 reader > ls *[eo2] | ./t2

(wrapped for mail)

,----
|   Use of uninitialized value $mode in concatenation (.) or 
|   string at ./t2 line 9, <> line 1.  one:
|  
|   [...] snipped same output for each file. 
`----

Script content
cat t2 
 #!/usr//bin/perl
 use strict;
 use warnings;
 my $mode;
 while(<>){
   chomp;
   $mode = (lstat( $_))[2];
   print "$_: "  . $mode . "\n";
 }


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to