Re: iterate over the use-d modules

2024-10-01 Thread Andy Bach
> Thanks, > Luca > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: regex

2024-01-22 Thread Andy Bach
quot;aa" is followed by a > "a" isn't something the expression prohibits. If you want that > try /^a{,2}$/ instead. > > Regards, > /Karl Hammar > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Fast of program

2023-10-16 Thread Andy Bach
program faster? > > Perl is the fastest, taking 1.9s. Ruby is the second fast, taking 3.0s. > Scala script is the slowest, taking 4.0s. > > Maybe I can use a algorithm but what? > > -- > > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The unive

Re: My progress in Perl

2023-08-07 Thread Andy Bach
t; I am boring and tired > > *I must be a success!* > > PD: Add your anecdote with this language. > > -- > > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system > ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org > ⠈⠳⣄ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: What is the meaning of $normalize->{$1}

2023-06-15 Thread Andy Bach
s. At the begin of the perl program the is no "use > ". > > -- > > fr.gr. > > Freek de Kruijf > > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: What is difference in this pattern?

2022-09-17 Thread Andy Bach
> > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system > ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org > ⠈⠳⣄ > -- Andy Bach afb...@gmail.com Not at my desk

Re: Which distribution of PERL to use

2022-07-08 Thread Andy Bach
/downloading-and-installing-perl-in-2021/ On Mon, Jul 4, 2022 at 7:53 PM Mr. Faiz Ul Haq Zia wrote: > Hello, > Which one of the PERL distribution should I use on windows 11. > regards > Faiz ul haque Zeya > Senior Associate professor BUKC > -- Andy Bach afb...@gmail.com Not at my desk

Re: No decode delegate for this image format `PNG'

2022-01-25 Thread Andy Bach
gt;> gifaninmation.pl line 12. >> Exception 410: no images defined `Image::Magick::Q16HDRI' @ >> error/Q16HDRI.xs/XS_Image__Magick__Q16HDRI_Write/15195 at >> gifaninmation.pl line 15. >> > > According to this article I have installed * libpng *but the error is > present. > https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=14301 > > > > -- > > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system > ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org > ⠈⠳⣄ > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: run cmd, writing output to log file

2021-10-05 Thread Andy Bach
$log "$PaddedDateStr $_"; >> } >> >> print $log "\n"; >> >> close $log; >> >> sub pd { >> my ($mon,$mday,$year,$hour,$min,$sec,$wday) = >> (localtime(time))[4,3,5,2,1,0,6]; >> $year -= 100; ## gives 2 digit (with %02d) >> $mon += 1; >> >> my $PDS = sprintf "%02d%02d%02d:%02d%02d%02d %d", >>$year,$mon,$mday,$hour,$min,$sec,$wday; >> return $PDS; >> } >> --- --- ---=--- --- --- >> At first glace, looks like $log was used instead of instead of $fh. >> > Ken > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: avoid errors when printing to socket

2021-10-01 Thread Andy Bach
"); close OUT ;my $res = print OUT "hi mom\n"; say $res; sleep 10'& [1] 36594 print() on closed filehandle OUT at -e line 1. Use of uninitialized value $res in say at -e line 2. $ kill -SIGPIPE 36594 pipe $ On Thu, Sep 30, 2021 at 5:20 PM hw wrote: > On Thursday

Re: avoid errors when printing to socket

2021-09-30 Thread Andy Bach
t; error message and there isn't anything I could do about it. > > https://perldoc.perl.org/functions/print says that 'print' would return > true > if successful and doesn't say what it returns otherwise. It also says > that > "Printing to a closed pipe or socket will generate a SIGPIPE signal." > > So I tried to install a signal handler, but either I did that wrong, or no > signal was generated. What can I do? > > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Where do messages sent with syslog go when there is only a journal?

2020-05-19 Thread Andy Bach
ated? > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Config::General save_file() not converting named block to nested block when there is only one block

2020-02-26 Thread Andy Bach
rp'; > > I get the following result: > > > city Brussels > > > But also in such a case I want to get > > > > city Brussels > > > > Is there a way to get this result in such a case? > > > -- > Kind regards,

Re: Apache2 to perl slow start

2019-11-13 Thread Andy Bach
cript started from console work like a charm > > Good day, > > HS > > -- > > Regards, > Condor > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: about package method returns

2019-10-31 Thread Andy Bach
ew(); >unless ($p->ping($host)) { >$p->close(); >return 0; >} > } > > 1; > > package main; > > A::mytest('www.google.com'); > > print B::mytest('www.google.com'); > > > > When I run it, always get: &g

Re: Help me with a regex problem

2019-10-25 Thread Andy Bach
't get the good > > result with one regex to match both lines. > > > > Can you help? > > > > Thanks, > > Maggie > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: function alias

2019-09-04 Thread Andy Bach
As an aside, Perl 5.10 and up, you can get the "say" command by enabling extended functions: perl -E 'say "hi mom" ' hi mom\n https://perlmaven.com/what-is-new-in-perl-5.10--say-defined-or-state a On Wed, Sep 4, 2019 at 1:08 PM Andy Bach wrote: > > >

Re: function alias

2019-09-04 Thread Andy Bach
s. > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk -- To unsubscribe, e-mail: beginners-unsubscr..

Re: Making use of XML::Feed->parse() more robust

2019-08-29 Thread Andy Bach
ybe. It’d just be a mod you’d have to maintain. You could also go to cpan and offer a suggestion to the author(s) or even a patch. TIMTOWTDI On Thu, Aug 29, 2019 at 11:20 AM Lars Noodén wrote: > On 8/28/19 7:33 PM, Andy Bach wrote: > > Look at eval blocks - lets you trap fatal errors from ot

Re: Geo::WebService::Elevation::USGS

2019-08-28 Thread Andy Bach
a->get($url); > > if ($response->is_success) { > > print $response->content; > > } else { > > die $response->status_line; > > } > > print "All done.\n\n"; > > > > __END__ > > > > Dumps the page or elevation depending on url: > > > > perl test.pl > > > ?> > y="34.0">3DEP 1/3 > > > arc-second916.71FeetAll > > > done. > > > > > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- Andy Bach afb...@gmail.com Not at my desk

Re: Making use of XML::Feed->parse() more robust

2019-08-28 Thread Andy Bach
le program to a > halt? > > Thanks, > Lars > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- Andy Bach afb...@gmail.com Not at my desk

Re: Geo::WebService::Elevation::USGS

2019-08-27 Thread Andy Bach
g in any > coordinates or something else is needed. > > uri > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- Andy Bach afb...@gmail.com Not at my desk

Re: Help with Perl 6 script

2019-08-12 Thread Andy Bach
Yes, Perl 5 and Perl 6 are quite different in many ways. Some suggested that Perl 6 be looked at as not the next iteration of Perl but a new language that can be made backward compatible with Perl 5 (there are switches etc that let you run P5 code unchanged) but it is not the case of P5 being a

Re: datatables

2019-07-17 Thread Andy Bach
rto wrote: > > dear Andy and all, > > I opened and read the apache error log. it said there is an invalid > character. And I think there is a unicode character. My question is also > how to pass a unicode data from mysql to a browser through JSON. > > in the mysql connection, I al

Re: datatables

2019-07-15 Thread Andy Bach
atement > if( $params->{iSortingCols} ){ > $sql .= ' ORDER BY'; > foreach my $c (0 .. ( $params->{iSortingCols} -1 )){ > $sql .= ' ' . $columns[ $params->{"iSortCol_$c"} ] . ' ' . > $params->{"sSortDir_$c"}; > $sql .= ',' > } > $sql =~ s/,$//; > } > > # Limit the output and also allow to paginate or scroll infinitely > #print $table_length; > $sql .= " LIMIT ? OFFSET ?"; > push @values, (($params->{iDisplayLength} > 0 ? > $params->{iDisplayLength} : 25), ( $params->{iDisplayStart} // 0)); > print ($sql); > # Fetch the data from the database > $data = $dbh2->selectall_arrayref($sql, { Slice => [] }, @values); > print ($data); > > > # Return the JSON object > print $q->header('application/json'); > my $json = encode_json({ aaData => $data, iTotalRecords => $count, > iTotalDisplayRecords => $count, sEcho => int($params->{sEcho}) }); > #my $json = encode_json({ tableLength => $table_length, iTotalRecords => > $count, params=>$params, iTotalDisplayRecords => $count, sEcho => > int($params->{sEcho}) }); > > print $json; > > $dbh2->disconnect(); > > I tried to understand, by doing the inspect element, nothing appears in > debugger. > > > Please help > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: proper use of TEMPLATE

2019-04-15 Thread Andy Bach
all comments you experienced people send me. >> Thanks! >> >> Rick Triplett >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ >> >> >> -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Common regex for timedate

2018-11-14 Thread Andy Bach
x27; Thu Jul 5 10:19:42 CDT 2018 $ date -d '10/17/18 12:28:12' Wed Oct 17 12:28:12 CDT 2018 so, for epoch seconds $ date -d '10/17/18 12:28:12' "+%s" 1539797292 $ date -d '05-JUL-18 10:19:42 ' "+%s" 1530803982 That's ignoring TZ On Tue, No

Re: Common regex for timedate

2018-11-13 Thread Andy Bach
.10.18 12:28:12,447849 +02: > > I created on regex : \d\d\.\d\d\.\d\d\s[012][0-9]:[0-5][0-9]:[0-5][0-9] > this only matches : Calling apply.sql on 17.10.18 12:28:12,447849 +02: > > I need a common regex which matches both the lines ? > > > Thanks, > -- > Asad Hasan > +91 9582111698 > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: How to compare timestamp in two different files(regex)

2018-10-24 Thread Andy Bach
gt;>>> > >>>>>> > DUP-05004: statement1 >>>>>> > >>>>>> > DUP-05007: statement2 >>>>>> > >>>>>> > >>>>>> > LOG file opened at 02/23/18 01:10:33 &g

Re: How to compare timestamp in two different files(regex)

2018-10-23 Thread Andy Bach
> so in this case file1 : Fri Feb 23 01:10:28 2018 >>>> >range file1 +2 mins :02/23/18 01:12:28 >>>> > check in file 2 nearest to file1 and within range : 02/23/18 >>>> 01:10:33 >>>> > >>>> > how do i compare two timestamps in different format and within range >>>> ? >>>> >>>> You would first convert the two timestamps to a common format, >>>> preferably one that used a numerical value to express times. I know of two >>>> such: the Unix epoch time that uses an integer to represent the number of >>>> seconds since 1 Jan 1970 UTM and the Julian date that uses a floating-point >>>> number to represent the number of days since 1 Jan 4713 BCE. >>>> >>>> Are you looking for a Perl solution or a Python one? >>>> >>>> For Perl, you should investigate time and date modules available on >>>> CPAN, such as Date::Manip or Date::Calc. >>>> >>>> >>> >>> -- >>> Asad Hasan >>> +91 9582111698 >>> >> >> >> -- >> Asad Hasan >> +91 9582111698 >> >> > > -- > Asad Hasan > +91 9582111698 > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: XML::LibXML and comments

2018-09-10 Thread Andy Bach
ciated. I'm kinda stuck with using > XML::LibXML though. > > John > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: regex to get the rpm name version

2018-08-09 Thread Andy Bach
egins with a letter > > (lower or upper) or a number up until you reach an > > hyphen sign (‘-‘). > > but it fails to match > > compat-libstdc++-33-3.2.3-71.el7.i686 > > Please let me know what regex should i use to extract all 3 > > rpms. > > Also let me know if there are web tools to build regex > > Good websites for regex tutorials. > > Thanks, > > > > -- > Asad Hasan > +91 9582111698 > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: slurp error

2018-07-27 Thread Andy Bach
$slurp; > { > local $/; > open my $fh1, '<', $file_to_convert > or die "Can't open $file_to_convert: $!\n"; > $slurp = <$fh1> > or die "Could not slurp $file_to_convert: $!"; > $slurp =~ s/\r/\n/xmsg; # swap Mac's CR for LF > $slurp =~ s/\x0b//xmsg; # swap Filemaker paragraph marker VT for > html > close $fh1; > } > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: confidence under BEGIN{}

2018-07-27 Thread Andy Bach
that the script is run relative to the current dir, not the dir where the script resides. That is, I keep my scripts in /usr/local/bin, so if I have a /home/andy/perl_lib full of my modules, I'd want to use lib '/home/andy/perl_lib'; In the previous command line examples: $ cd

Re: confidence under BEGIN{}

2018-07-26 Thread Andy Bach
.) at -e line 1. > > > Still got failed. > > Someone pointed to me that I should push @INC in BEGIN{}. > > $ perl -le 'BEGIN {push @INC,"./test"} use mytest' > > This works. > > So my question is what happens in BEGIN{} block? > > thanks. > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: help with another regex

2018-07-17 Thread Andy Bach
want to match: > > /path/ > /path/123 > /path/abc > > but /path/?xxx should not be matched. > > This works: > > $ perl -le '$x="/path/abc"; print 1 if $x=~m{path/\w+}' > 1 > > > this works too: > > $ perl -le '$x="/path/?a

Re: difficulty with matching

2018-06-01 Thread Andy Bach
gt; my $hyphen = $2; > $student_number = $3; > die "$student_surname, $hyphen, $student_number”; > > Rick Triplett > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: local and auto flush

2018-05-15 Thread Andy Bach
t;; > my $tt = Template->new( > ect. > > Many thanks! > Rick Triplett > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: regex with HEX ascii chars

2018-04-12 Thread Andy Bach
in gvim and do :as > > it reports the characters as > > 251, Hex 00fb, Octal 373 > 252, hex 00fc, Octal 374 > > However, when I try to seacch for it using > > if ($line=~/[\xfb|\xfc]/) { > > or even just > > if ($line=~/\xfb/) { > > it always fails. What am I doing wrong? > > Gary > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Checking if a website is up doesn't work correctly

2018-02-13 Thread Andy Bach
ser to get around the policy. But your urls so far have shown some odd repsonse using wget so you may want to check them out first before your script has at them. On Tue, Feb 13, 2018 at 2:34 PM, Manfred Lotz wrote: > On Tue, 13 Feb 2018 13:50:55 -0600 > Andy Bach wrote: > > > $ wg

Re: Checking if a website is up doesn't work correctly

2018-02-13 Thread Andy Bach
59.6KB/s in 0.6s 2018-02-13 13:42:55 (59.6 KB/s) - ‘OFL’ saved [37439] so it may not be following the 302s. I'm not sure you're using the correct tool here. A little more straight forward andy@wiwmb-md-afb-mint:~/spam$ wget http://scripts.sil.org/robots.txt --2018-02-13 13:47:2

Re: Checking if a website is up doesn't work correctly

2018-02-13 Thread Andy Bach
line 8. > > > However, firefox shows the site works ok. > > > What am I doing wrong? > > > -- > Thanks, > Manfred > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: What is time, anyway?

2018-01-29 Thread Andy Bach
timestamp comparisons will be accurate. If there's a possibility > that they won't be the same, then I'll need to convert them so that they > will be the same. > > Thanks, > Frank > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: perlbrew and modules

2017-12-07 Thread Andy Bach
an set to add libraries (maybe in the webserver config). On Thu, Dec 7, 2017 at 5:29 PM, SSC_perl wrote: > > On Dec 7, 2017, at 3:09 PM, Andy Bach wrote: > > > > Can you not look a the web server's error_log? A 500 error would put > the perl error msg in there. Have you t

Re: perlbrew and modules

2017-12-07 Thread Andy Bach
; Thanks, > Frank > > > > > #!/home/user/perl5/perlbrew/perls/latest/bin/perl > > use v5.26; > use warnings; > use diagnostics; > > print "Content-type: text/html\n\n"; > say 'Perl '. $^V; > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Unescaped Left Brace

2017-11-24 Thread Andy Bach
> >> I see this: >> http://www.perlmonks.org/?node_id=1104517 >> >> I also see that escaping it with my ActiveState Perl >> messes up it's function entirely, but still allows it >> to run with no errors so I say this is a huge >> problem. Seems like the migration to Perl 5.30 is going to >> be interesting to say the least. >> >> Anybody have any other comments about this? >> >> >> Mike Flannigan >> >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ >> >> >> > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Getting the results of a remote script

2017-11-09 Thread Andy Bach
m after? > > Thanks, > Frank > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Archive::Zip->addTree returned 2

2017-10-04 Thread Andy Bach
ified action. > error: undef returned by _untaintDir on cwd at > /Location/lib/Archive/Zip/Archive.pm > line 754 > Archive::Zip::Archive::addTree('Archive::Zip::Archive=HASH(0x1113ceee8)', > '/Location/patch1//') > > > Seems to me a permission issu

Re: help check a piece of code

2017-04-10 Thread Andy Bach
de::encode_utf8( chr(182) ) eq pack( 'H*', 'C2B6' ); }, "\n"; print "s: ", scalar eval { Encode::encode_utf8( chr(182) ) eq pack( 'H*', 'C2B6' ); }, "\n"; print "s: ", Encode::encode_utf8( chr(182) ) eq pack( 'H*', 'C2B6' ) , "\n"; printf("c: %c %s\n", chr(182), pack( 'H*', 'C2B6' ) ); $ perl /tmp/r.pl r: Encode::XS=SCALAR(0xb39ff0) r: Encode::XS r: Encode::XS r: s: 1 s: 1 s: 1 c: ¶ -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Uninitialized Value, but It Isn't, so Why?

2017-03-02 Thread Andy Bach
st5\n"' Use of uninitialized value $interdest5 in numeric eq (==) at -e line 1. Use of uninitialized value in numeric eq (==) at -e line 1. i: Hah! "undef" is an uninitialized value ! -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: newbie question for parsing incoming mails

2017-02-15 Thread Andy Bach
x27;}}; # or otherwsie do it in list > context it works > > print @subject; > > > when I run it, I do not get anything. > > please help. > > regards, > Eko > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: warnings in Math::Complex

2017-02-09 Thread Andy Bach
s a subroutine prototype (see perldoc perlsub) saying "no parameters" while the second allows the same thing but doesn't enforce it via a prototype. I believe there's a way to turn on warnings but have it ignore prototype mismatches, if that'd help. I'd have to googl

Re: Problems displaying Perl structures

2016-02-17 Thread Andy Bach
7;group3' => '10.100.27.54', 'group4' => '10.100.27.55', 'group5' => '10.100.27.56', 'group6' => '10.100.27.57' #Last element has no comma... 'group7' => '10.100.27.57' #Last element has no comma... }; and now you have a syntax error. You can leave the last element's comma, Perl will basically ignore it in building the hash (or array) -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Is perl user specific

2016-01-06 Thread Andy Bach
On Wed, Jan 6, 2016 at 9:46 AM, Dermot wrote: > You could try the `which` command if you are using a *nix based OS. For > instance; > > >which perl > /usr/bin/perl > and, to go a little further, as /usr/bin/perl is the most likely and so it's probably the 5.005 version, you could look at /usr/lo

Re: UnixDate export problem

2015-11-06 Thread Andy Bach
On Fri, Nov 6, 2015 at 11:56 AM, Andy Bach wrote: > Uxix is actually a misspelling it'd be "Unix" > ... > So you can just drop the qw-ed name list. Heh heh ... or leave it in (the idea being to limit the imported names into your namespace ... or something) as

Re: UnixDate export problem

2015-11-06 Thread Andy Bach
beginner with perl). So, assuming > there is no typo or bug in the script will someone > please point me toward a source that explains what > is (or isn't) happening here. > > BTW, I'm using perl5 version 20 subversion 2 on Ubuntu 15.10 > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: generate XML from recursion

2015-07-08 Thread Andy Bach
foreach my $file (@files) { # generate XML here if(-d "$dir/$file" and ($file !~ /^\.\.?$/) ) { # make dir branch Traverse("$dir/$file");

Re: Getting 2/8 as output

2015-06-17 Thread Andy Bach
rg > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: read/write to command line opened as a file

2015-04-20 Thread Andy Bach
al Communication with Yourself" in perlipc You may also use the IPC::Open3 module (part of the standard perl distribution), but be warned that it has a different order of arguments from IPC::Open2 (see IPC::Open3). -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Bizarre copy of HASH in list assignment...

2015-03-31 Thread Andy Bach
ng the following to the anon sub: ... -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Tie::IxHash module

2015-02-19 Thread Andy Bach
in the README something like (well, once it was like this, been a while since I've done it): $ perl Makefile.PL $ make $ make test $ sudo make install but copying, unless it really is just a single file, won't work. In the above case, you'd need to at least copy the file IxHash.pm t

Re: can locate pm

2015-02-19 Thread Andy Bach
n zero (which'd be "mkdir" there): ---y "yanks" and puts that space separated word from the previous cmd. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: should this old forumulation still work?

2015-01-20 Thread Andy Bach
. The output separator variable ($\ aka $OUTPUT_RECORD_SEPARATOR) will change what print appends to the end of each print stmt. Default is undef (which is where the v6 "say" comes in). You'll have to do the work yourself $contents =~ s/\n+/ /g; # change all into one line - single

Re: [perl-108] Fwd: Online Perl courses for PM list Newbies

2015-01-20 Thread Andy Bach
on into your > >> Perl community, please point your newbies at geekuni.com > >> > >> To make them feel even more welcome, this coupon > >> > >> PM2015 > >> > >> will give them a 15% discount on their first month. > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: say,

2015-01-05 Thread Andy Bach
te sequence. Though I get the same output for: $ perl -e '{ local $\ = "\n"; print "hi" }' | perl -ne "print( ord($_), qq{ }) foreach split(//)" 104 105 10 on, Mac, windows and Linux. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Andy Bach
he win there isn't just sharing the code but the return from the error > handler goes back to the user's caller and not to a sub in the module. > Yes, that would be useful too. I must have forgot that aspect of "&" calls ;-> -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Is There a Way to Make Uninitialized Warnings Fatal?

2014-12-10 Thread Andy Bach
} I was thinking this would be a neat place to show the remaining reason for using "&" to mark a function call - it sends the current "@_" to that function, but I couldn't get it to work. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: CGI::Application::Plugin::TT

2014-11-13 Thread Andy Bach
l5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .). BEGIN failed--compilation aborted. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: map vs foreach

2014-10-01 Thread Andy Bach
uct/9780596001735.do [2] quoted here: http://www.perlmonks.org/?node_id=809543 Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Difference between list and arrays.

2014-09-16 Thread Andy Bach
quot;, "array context" or, for that matter, plain old "context" but .. -- a [1] perl -we 'my $s_e = ("x", "y", "z")[1]; print "$s_e\n"' same as: perl -we 'my $s_e = qw(x y z)[1]; print "$s_e\n"' and: perl -we 'my ($s_e) = qw(x y z)[1]; print "$s_e\n"' Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Difference between list and arrays.

2014-09-16 Thread Andy Bach
at -e line 1. Odd number of elements in hash assignment at -e line 1. Use of uninitialized value in concatenation (.) or string at -e line 1. [2] http://stackoverflow.com/questions/7427381/what-do-you-get-if-you-evaluate-a-hash-in-scalar-context Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Which perl for Windows?

2014-08-06 Thread Andy Bach
od things about Padre as a Perl IDE which can be used w/ any distro. I'm a vim user myself so take this all w/ a grain of NaCl2 but brian d foy and Damien C. recommend it: http://damienlearnsperl.blogspot.com/2009_09_01_archive.html others http://theory.uwinnipeg.ca/CPAN/perl/pod/perlfa

Re: Date::Parse and strange dates

2014-07-25 Thread Andy Bach
s/(\w+, \s+ \d+ \s+ \w+ \s+ \d+ \s+ [\d:]+) ([+-]\d+/$1 $2/xms ) warn("Fixed bad date str $_\n"); } either after Date::Parse has failed (and so retry) or a test before, just in case. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Problem installing a module

2014-07-23 Thread Andy Bach
t; Can't create temporary file. > That's likely a permissions problem; either the tmp file location doesn't exist or is owned/group/permed (on a linux box) to a configuration that won't let the user running ScanStream to write there. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: script to match a valid email id

2014-07-10 Thread Andy Bach
gular-expression-to-match-e-mail-addresses "Mastering Regular Expressiong" (O'Reilly - J. Freidl) is a wonderful book and he's got an RE in there that tries to handle the full RFC (5322?) specification but he admits it's not perfect. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Stopping undefined warnings

2014-06-17 Thread Andy Bach
uot;} ; my $upload = $global->{form}->{image_upload} ; print "form: $upload\n"; $upload = $global->{fom}->{image_upload} ; print "fom: $upload\n"; $ perl /tmp/h.pl form: image Use of uninitialized value in concatenation (.) or string at /tmp/h.pl line 9. fom: -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Brackets in scalar and array

2014-05-29 Thread Andy Bach
h elements, they get "undef". An array in scalar context returns it's element count, so you can do: if ( @test == 4 ) { print "There's 4 things in \@test!\n"; } -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: File checks

2014-05-22 Thread Andy Bach
tat($fname); print "yes\n" if ( -f _ and not -l _ )' yes $ rm st $ ln -s nohup.out st $ perl -e '$fname = "st"; lstat($fname); print "yes\n" if ( -f _ and not -l _ )' $ perl -e '$fname = "st"; lstat($fname); print "yes\n" if ( -l _ and not -f _ )' yes -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: [irc Q] how to extract info to disk

2014-05-08 Thread Andy Bach
/www.preshweb.co.uk/ www.preshweb.co.uk/twitter > www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook > www.preshweb.co.uk/cpanwww.preshweb.co.uk/github > > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: use sys::virt module to manage VM in kvm

2014-03-28 Thread Andy Bach
# same thing, but less efficient eval '$answer = $a / $b'; warn $@ if $@; # a compile-time error eval { $answer = }; # WRONG # a run-time error eval '$answer =&

Re: Log4Perl query

2014-03-28 Thread Andy Bach
gger($category)" method to obtain a reference to the one and only possible logger object of a certain category. That's called a singleton if you're a Gamma fan. and so: #$logger->get_logger('LOG2'); $logger = Log::Log4perl->get_logger('LOG2'); seems to work. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Match Variables Not Working in m//

2014-03-19 Thread Andy Bach
_player = $6; "; } else { print "failed to match\n"; } gets: # perl -w /tmp/d.pl found: H = H; K53 = K53; deloresg = deloresg; Bills = Bills; Hank99 = Hank99; Pellinor = Pellinor; -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: regex and parse

2014-03-11 Thread Andy Bach
#x27;s not just Perl REs but he covers and compares many other languages. It's also funny, as in LOL! -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: list to hash puzzle

2014-02-09 Thread Andy Bach
g - just need to have the last line be the one that returns your expected list. I'm guessing there's something more to the process here. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: inserting a variable server name into code

2013-12-20 Thread Andy Bach
define vars there BEGIN { our $server_path = "/opt/app/web/support"; chdir $server; } use lib "$server_path"; and have them available elsewhere. Not sure it's a good idea though ;-> -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Not following the action here.

2013-10-04 Thread Andy Bach
$debug = 10; ... print "in <> loop: \$_=$_\n" if $debug > 8; just remember to set it to zero (not just: my $debug; which set it to undef) when you're done, to avoid warnings. There are, of course, modules you can use to make this nicer, easier but ... -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: question about perl 6 sigils

2013-09-24 Thread Andy Bach
the reads just for the jokes) try also: http://feather.perl6.nl/syn/Differences.html#Sigils http://feather.perl6.nl/syn/S02.html#Sigils for the modern-er docs. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: About variables passed to sub routines

2013-09-24 Thread Andy Bach
-f "@_" works if there's just one element. I prefer my ($fname) = @_; as it's easy to expand to add more params my ($fname, $fsize_max) = @_; -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: question about perl 6 sigils

2013-09-24 Thread Andy Bach
o think we're losing clarity. Both have arguments and, as it happens, both arguments have proponents in the design of Perl committee (sometimes known as "@larry" ;-); only, for now, the sigil constancy crowd has one. Maybe in P7 they'll've regained their sigils, er, senses. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: question about perl 6 sigils

2013-09-23 Thread Andy Bach
enius" some people weren't too thrilled but it was Perl ... I liked it, after I understood it. But now - here, ask Damian (search for sigil) http://www.perl.com/pub/2001/05/08/exegesis2.html -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Recursive Validation Function

2013-09-02 Thread Andy Bach
an infinite > loop, prompting for valid tokens, but even if valid ones are entered it > continues. What am I missing? > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Array iterator count

2013-08-08 Thread Andy Bach
7;s the 5th element ahead of time? But it seems like there'd have to be something else involved that eliminates a counter var. a Andy Bach (608) 658-1890 Not at my desk On Aug 8, 2013, at 8:05 PM, Michael Rasmussen wrote: > And buggy, consider: >my @timings ( 11, 22, 3, 14,

Re: Array iterator count

2013-08-08 Thread Andy Bach
{ but that's sort of silly. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Always use strict

2013-08-05 Thread Andy Bach
On Aug 6, 2013, at 7:09 AM, Peter Gordon wrote: > I'm confused by this documentation. > http://perldoc.perl.org/functions/use.html > Does it mean that: > use 5.12.0; > automatically turns on "use strict;" ? That's the way I read this use VERSION also enables all features available in the reque

Always use strict

2013-08-05 Thread Andy Bach
Nice article from the "Perl Maven" http://perlmaven.com/strict From the really useful newsletter http://perlmaven.com/perl-maven-newsletter a Andy Bach (608) 658-1890 Not at my desk

Re: cpan App::cpanminus

2013-07-23 Thread Andy Bach
to have them rectify this. error id: "bad_httpd_conf" Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Parsing Data

2013-07-22 Thread Andy Bach
[^>]+)>/ ) { $business_info{$1} = $2;# e.g. address => "Business Address" } } # while DATA -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Perl file and STDERR

2013-07-10 Thread Andy Bach
); You can even use this same approach on the standard package-scoped filehandles: use IO::Handle;*# and later...* *STDOUT->autoflush( ); a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: Perl file and STDERR

2013-07-09 Thread Andy Bach
se -i renames or deletes the original file before creating a new file of the same name, UNIX-style soft and hard links will not be preserved. Finally, the -i switch does not impede execution when no files are given on the command line. In this case, no backup is made (the original file cannot, of course, be determined) and processing proceeds from STDIN to STDOUT as might be expected. -- a Andy Bach, afb...@gmail.com 608 658-1890 cell 608 261-5738 wk

Re: last

2013-06-27 Thread Andy Bach
l quesiont p5p stands for Perl 5 Porters, the list dedicated to those folks working/maintaining Perl v5 (until Xmas when Perl 6 [1] is out ;-) http://lists.perl.org/list/perl5-porters.html A list for people interested in Perl5 core development. High volume. -- a [1] "I Didn't say which

  1   2   3   >