Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Length of Array Passed as Reference

by afoken (Canon)
on Dec 10, 2020 at 08:21 UTC ( #11124930=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub test_function {
        my $ref = shift;    # this function takes one argument, a ref to a
    +n ARRAY
    ...
        # Not necessarily recommended: shown for educational purposes.
        defined($ref) or die "oops: you did not pass any arguments";
        @_ and die "oops: this function takes exactly one argument";
    
  2. or download this
    use strict;
    use warnings;
    ...
       test_function(undef);
    };
    say $@;
    
  3. or download this
    X:\>perl foo.pl
    Calling test_function with no arguments:
    ...
    
    
    X:\>
    
  4. or download this
    use strict;
    use warnings;
    ...
       test_function(undef);
    };
    say $@;
    
  5. or download this
    X:\>perl foo.pl
    Calling test_function with no arguments:
    ...
    
    
    X:\>
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124930]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (1)
As of 2022-01-27 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (72 votes). Check out past polls.

    Notices?