Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Timer subtraction

by sundialsvc4 (Abbot)
on Oct 06, 2017 at 12:21 UTC ( #1200822=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $first = "00:00:01:04";
    my $last = "00:00:08:861";
    
    my $output = $first-$last;
    
  2. or download this
      my $dt = DateTime->new(
          year       => 1966,
    ...
          nanosecond => 500000000,
          time_zone  => 'America/Chicago',
      );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1200822]
help
Chatterbox?
[Eily]: choroba but does $name = $1 solve the issue ?
[Eily]: if so, most subs start with my (VARIABLES) = @_ anyway
[moritz]: for short subs, I sometimes let them work on $_[0] directly
[Eily]: moritz but that should be fine unless you modify them
[choroba]: if you modify them, Perl will crash with "Modification of a read-only value attempted" for $1

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2018-02-22 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (296 votes). Check out past polls.

    Notices?