in reply to Re^2: Date Timezone
in thread Date Timezone
Hi, stevieb already mentioned this, but just to be clear: If your code is really how you've written it here, your sub is requiring that no arguments be passed to it. The code shown should throw an error if you try to pass it the arguments that you then try to load into @_ ... so are you getting that error? Or have you contrived some way to suppress the error? Or, is this not really the code you are using?
(For more detail, see Prototypes in perlsub.)$ perl -Mstrict -wE 'sub foo{ my $bar = shift; say $bar } foo("baz");' baz $ perl -Mstrict -wE 'sub foo(){ my $bar = shift; say $bar } foo("baz") +;' Too many arguments for main::foo at -e line 1, near ""baz")" Execution of -e aborted due to compilation errors.
|
|---|