Re: about package method returns

2019-10-31 Thread Maggie Q Roth
rr, e.g.: > $ test_net_ping.pl > A::mytest died, saying can't ping www.google.com at /usr/local/bin/ > test_net_ping.pl line 14. > > Just to note, as a package test, normally, your package A and B would be > separate scripts (say Apingtest.pm and Bpingtest.pm, in the @INC path)

Re: about package method returns

2019-10-31 Thread Maggie Q Roth
} > > > > https://perldoc.perl.org/functions/die.html > https://perldoc.perl.org/functions/warn.html > https://perldoc.perl.org/perlvar.html#Error-Variables > > On Thu, 31 Oct 2019 at 09:42, Maggie Q Roth wrote: > >> Hello >> >> Sorry I am new to per

about package method returns

2019-10-31 Thread Maggie Q Roth
Hello Sorry I am new to perl, I was reading the charter about package. I tried to write the code below: use strict; use Net::Ping; package A; sub mytest { my $host = shift; my $p = Net::Ping->new(); unless ($p->ping($host)) { $p->close(); die "can't ping $host"; } }

Re: Help me with a regex problem

2019-10-25 Thread Maggie Q Roth
what's V.*? Maggie On Fri, Oct 25, 2019 at 6:28 PM Илья Рассадин wrote: > For example, this regex > > /(?[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})\s+(?\/.*)/ > > On 25.10.2019 13:23, Maggie Q Roth wrote: > > Hello > > > > There are two primary types

Help me with a regex problem

2019-10-25 Thread Maggie Q Roth
Hello There are two primary types of lines in the log: 60.191.38.xx/ 42.120.161.xx /archives/1005 I know how to write regex to match each line, but don't get the good result with one regex to match both lines. Can you help? Thanks, Maggie