Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Passing a scalar to a subroutine

by Anonymous Monk
on Feb 02, 2012 at 15:22 UTC ( #951466=note: print w/replies, xml ) Need Help??


in reply to Passing a scalar to a subroutine

Actually argument passing isn't the problem in your code. Since you define $value in a file scope, it's visible to your subroutine w/o being passed.

If I may draw your attention to something else?

chomp ($input = <STDIN>); $input = $value; # <--- are we sure about this?!? #call subroutine to check user input verification($value)

If I may suggest $value = $input?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951466]
help
Chatterbox?
[Corion]: Discipulus: I think Module::Corelist ( or corelist ) can tell you that
[Corion]: Meh - Module::CoreList
[choroba]: Just use List::Util 1.29
[choroba]: Be kind to people using old Perl with newer version of the module
[Corion]: But why not simply specify 'List::Util' => 1.29 in your prerequisites? People might install a more recent version of the module into their Perl
[Corion]: (what choroba said)
[Discipulus]: ah! simpler and cleaner
[Discipulus]: thanks! use List::Util 1.29 qw(pairmap ... just works!

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2017-05-25 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?