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

Re: a question about pack

2010-08-23 Thread Albert Q
2010/8/22 Uri Guttman : >>>>>> "AQ" == Albert Q writes: > >  AQ> 2010/8/22 Uri Guttman >  >> >  >> >>>>> "AQ" == Albert Q writes: >  >> >  >> a quick comment. pack is most likely not a beg

Re: a question about pack

2010-08-23 Thread Albert Q
2010/8/22 Dr.Ruud : > On 2010-08-22 13:16, Albert Q wrote: > >> pack '(H*)*', @values   will get the correct result. > > Now go and read perlpacktut a few times. This problem is documented in perlpacktut clearly. Thank you. > -- > Ruud > > -- >

Re: a question about pack

2010-08-22 Thread Albert Q
2010/8/22 Uri Guttman > > >>>>> "AQ" == Albert Q writes: > > a quick comment. pack is most likely not a beginner issue. i am sure you > will get help here but think about better forums for asking about > pack. there are plenty. pack is powerful and some

a question about pack

2010-08-22 Thread Albert Q
Hi I have a text file containing hex strings such as: 12 34 56 78 90 ab cd ef now I want to change these hex strings to sequence of bytes with the relative value of 0x12 0x34 0x56 bellow are my codes use strict; use warnings; sub proc_file { my ($in, $out) = @_; open my $fin, '<', $

Re: Regexp to remove spaces

2009-12-21 Thread Albert Q
2009/12/20 Dr.Ruud > > sftriman wrote: > >> I use this series of regexp all over the place to clean up lines of >> text: >> >> $x=~s/^\s+//g; >> $x=~s/\s+$//g; >> $x=~s/\s+/ /g; >> >> in that order, and note the final one replace \s+ with a single space. >> > > The g-modifier on the first 2 is bog

"Multidimensional Associative Arrays" <<<--- do they exist ?

2002-08-27 Thread Q
Greetings. Is there such a thing as mutlidimensional associative array ? The reason I ask this is that I intent copy the contents of a time stamped file into one big file which will be used to update fields of a database. I intend using the filename ( remember it is time stamped) and use it as

Re: Read file from second line

2002-08-26 Thread Q
Thank you Tanton, Felix; - Original Message - From: "Felix Geerinckx" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 26, 2002 5:32 PM Subject: Re: Read file from second line > on Mon, 26 Aug 2002 15:15:06 GMT, [EMAIL PROTECTED] (Q) wrote: &g

Read file from second line

2002-08-26 Thread Q
Apologies for such a 'lame' question but i read the FAQ on http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq5-full.html How do i read on from the second line of a text file? thanks in advance ICQ : 165709889