Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: With substr, index the offset don't get proper start position

by tybalt89 (Parson)
on Mar 21, 2019 at 13:03 UTC ( #1231538=note: print w/replies, xml ) Need Help??


in reply to With substr, index the offset don't get proper start position

#!/usr/bin/perl # https://perlmonks.org/?node_id=1231527 use strict; use warnings; my $line='PSAPPSRV.26476584 (6) 01/02/19 06:30:30 GetCertificate(3) Re +turning context. ID=PTWEBSERVER, Lang=ENG'; my ($result) = $line =~ /^(?:\S* ){4}(.*)/; print "$result\n"; print "offset: $-[1]\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2019-05-26 20:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (153 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!