All,

How do accept pipe as an valid argument in perl, for example:

echo 123456 | ./convert_time.pl

convert_time.pl:
#!/usr/bin/perl

use POSIX qw(strftime);

my $time_in = $ARGV[0];
my $time_out = strftime "%Y%m%d", localtime($time_in);
print "$time_out\n";

rgrds,

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to