Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: hmm - - - something has changed in perl (from 5.34 to 5.36

by Tux (Canon)
on Nov 24, 2022 at 10:12 UTC ( [id://11148350] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use 5.026000;
    use warnings;
    ...
    GetOptions (
        "B|before=i" => \my $before, # An integer argument is required
        ) or die "User-friendly message\n");
    
  2. or download this
    GetOptions (
        "B|before:42" => \my $before, # An integer argument is optional an
    +d defaults to 42 when -B used without arg
        ) or die "User-friendly message\n");
    
  3. or download this
    GetOptions (
        "B|before:42" => \(my $before = 2),
        ) or die "User-friendly message\n");