Hi,
I saw some script on the net using prototype to define subroutines,
but most scripts are still not using it.
Is this a good practice/advisable (like use strict) and whats the benefits?
TIA.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On 9/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Consider this:
my $arg = @ARGV ? shift @ARGV : ;
Works as I expected, many thanks.
However, my previous code was:
my $time_in = $ARG[0] || ;
and it doesn't work, why and whats the different with yours?
rgds,
--
To unsubscribe, e-mail:
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: [