Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Using a subroutine as a module

by bradcathey (Prior)
on Nov 02, 2003 at 23:36 UTC ( [id://303965]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    $the_time = $val;
    
    if ($the_time) { print "$the_time\n" } else { print "error\n" }
    
  2. or download this
    #!/usr/bin/perl
    
    ...
        $val = shift;
        $val = ($val =~ /^(\d{2}):(\d{2}) (am|pm)$/) ? "$1:$2 $3" : 1;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-25 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found