[28769] in Perl-Users-Digest
Perl-Users Digest, Issue: 13 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 11 03:05:52 2007
Date: Thu, 11 Jan 2007 00:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 11 Jan 2007 Volume: 11 Number: 13
Today's topics:
Re: [Help] Need a class on mail() <tadmc@augustmail.com>
ASCII 0a vs 5c6e <michaellhartsough@sbcglobal.net>
Re: ASCII 0a vs 5c6e <paul@probulletin.com>
Call Perl in Verilog or SV? <zhushenli@gmail.com>
Re: Call Perl in Verilog or SV? <spamtrap@dot-app.org>
Re: Call Perl in Verilog or SV? (www.noveldv.com)
Re: Call Perl in Verilog or SV? <zhushenli@gmail.com>
CPAN Write Excel <GreggAllen@gmail.com>
Re: CPAN Write Excel <see.sig@rochester.rr.com>
Devel::Cover How to get a more indepth report <bpatton@ti.com>
Re: Fine grained time xhoster@gmail.com
new CPAN modules on Thu Jan 11 2007 (Randal Schwartz)
Re: Parsing an XML file and adding another tag, if the <tadmc@augustmail.com>
Perl DBI PostgreSQL <raminoacid@gmail.com>
Re: regex <asandstrom@accesswave.ca>
Re: regex <asandstrom@accesswave.ca>
Skip non english character values aaron80v@yahoo.com.au
Re: Skip non english character values <jurgenex@hotmail.com>
Re: using no strict "refs" (on aioe)
Re: Working with array references xhoster@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 10 Jan 2007 18:12:41 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: [Help] Need a class on mail()
Message-Id: <slrneqb07p.hjk.tadmc@tadmc30.august.net>
Kesavan Muthuvel <k7.india@gmail.com> wrote:
> I need a class/function in perl such that it accepts the parameters of
> standard mail variables of
> to,from,subject,message,etc... and mailed.
> Any links/referance /suggestions welcomed....
I suggest checking the Perl FAQ before posting to the Perl newsgroup:
perldoc -q mail
How do I send mail?
See also the CPAN:
perldoc -q CPAN
What modules and extensions are available for Perl? What is CPAN? What
does CPAN/src/... mean?
How do I install a module from CPAN?
and:
http://search.cpan.org/search?query=mail
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 10 Jan 2007 17:27:37 -0600
From: "Mike Hartsough" <michaellhartsough@sbcglobal.net>
Subject: ASCII 0a vs 5c6e
Message-Id: <yDeph.26543$QU1.5276@newssvr22.news.prodigy.net>
I'm a perl neophyte, and I'm running into some difficulty with some text I
need to parse.
I invoke a command that returns a large chunk of text. Included in this text
are newline ASCII characters (0a), and one instance of the text string "\n"
(5c6e).
I need to remove all text up to and including the first newline (0A) (which
includes the "\n"), but the code I've been writing appears to _sometimes_
treat the "\n" (5c6e) as a newline. But when I try to account for this in my
code, it doesn't seem to work.
Here's what I have right now:
$Blob =~ /(\n)(\n)(.*)/s;
I'm using the 's' qualifier because I want it to ignore all the subsequent
newlines.
With the two "(\n)" it skips too many newlines and strips out needed text.
If I remove one of the "(\n)", it treats the text "\n" (5c6e) as a newline,
so it doesn't strip out enough.
Help?
Thanks,
Mike
------------------------------
Date: 10 Jan 2007 17:08:56 -0800
From: "Paul" <paul@probulletin.com>
Subject: Re: ASCII 0a vs 5c6e
Message-Id: <1168477736.288307.189140@i56g2000hsf.googlegroups.com>
For the literal \n use...
\\n
------------------------------
Date: 10 Jan 2007 18:38:03 -0800
From: "Shenli" <zhushenli@gmail.com>
Subject: Call Perl in Verilog or SV?
Message-Id: <1168483083.665935.215090@o58g2000hsb.googlegroups.com>
Hi all,
Sometimes, I want to do some sophisticated text operation in Verilog or
SystemVerilog testbench. And we all know that Verilog and SV is like
C/C++ and not very good at text manipulation.
Is there any method to call Perl routine in Verilog or SV? Pass
argument to Perl routine can be better. BTW, I use Cadence NC tools.
Best regards,
Davy
------------------------------
Date: Wed, 10 Jan 2007 22:15:42 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Call Perl in Verilog or SV?
Message-Id: <m2r6u2ckyp.fsf@Sherm-Pendleys-Computer.local>
"Shenli" <zhushenli@gmail.com> writes:
> Is there any method to call Perl routine in Verilog or SV?
Libperl has a C API that will allow you to link a Perl interpreter into
your app and call Perl functions from C.
Have a look at the following:
perldoc perlembed
perldoc perlxs
perldoc perlguts
perldoc perlcall
perldoc perlapi
Whether that's useful to you or not will depend on Verilog or SV's ability
to link against external libraries and call C functions.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: 10 Jan 2007 21:14:50 -0800
From: "Ajeetha (www.noveldv.com)" <ajeetha@gmail.com>
Subject: Re: Call Perl in Verilog or SV?
Message-Id: <1168492490.057842.186330@i39g2000hsf.googlegroups.com>
One of the simplest (and of limited capability as well) is to use:
$system ("perl my_script.pl");
Ajeetha, CVC
www.noveldv.com
Shenli wrote:
> Hi all,
>
> Sometimes, I want to do some sophisticated text operation in Verilog or
> SystemVerilog testbench. And we all know that Verilog and SV is like
> C/C++ and not very good at text manipulation.
>
> Is there any method to call Perl routine in Verilog or SV? Pass
> argument to Perl routine can be better. BTW, I use Cadence NC tools.
>
> Best regards,
> Davy
------------------------------
Date: 10 Jan 2007 22:41:41 -0800
From: "Shenli" <zhushenli@gmail.com>
Subject: Re: Call Perl in Verilog or SV?
Message-Id: <1168497701.064687.191190@77g2000hsv.googlegroups.com>
Hi Ajeetha,
Thanks a lot for the help :-)
I have tried your suggestion and it work OK.
But when I try to pass a string to $system(), the ncvlog said "Using
String without index is not supported in the given context."
The code I write like below,
//---------------------
string perl_cmd_str = "";
$sformat(perl_cmd_str,"perl ./perl/test_opt_file.pl -a %0d -b 4",
data_a);
$display("string is %s\n", perl_cmd_str);
$system (perl_cmd_str);
//---------------------
Any suggestion on how to input a string to $system()?
Best regards,
Shenli
Ajeetha (www.noveldv.com) wrote:
> One of the simplest (and of limited capability as well) is to use:
>
> $system ("perl my_script.pl");
>
> Ajeetha, CVC
> www.noveldv.com
> Shenli wrote:
> > Hi all,
> >
> > Sometimes, I want to do some sophisticated text operation in Verilog or
> > SystemVerilog testbench. And we all know that Verilog and SV is like
> > C/C++ and not very good at text manipulation.
> >
> > Is there any method to call Perl routine in Verilog or SV? Pass
> > argument to Perl routine can be better. BTW, I use Cadence NC tools.
> >
> > Best regards,
> > Davy
------------------------------
Date: 10 Jan 2007 19:11:14 -0800
From: "Gallon" <GreggAllen@gmail.com>
Subject: CPAN Write Excel
Message-Id: <1168485074.458575.301830@i56g2000hsf.googlegroups.com>
I have MS Excel spreadsheets with tons of formulas and data already in
them, so I was very excited about discovering
"Spreadsheet::WriteExcel". This would allow me to write data directly
from my Perl scripts, rather than cutting and pasting. The only
drawback, except for me being an idiot or a luddite, is the module only
seems to have a "new" constructor! I need an "open" constructor, or
whatever. Does anyone know how I might do this???
Sincerely,
Gregg Allen
------------------------------
Date: Wed, 10 Jan 2007 23:05:41 -0500
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: CPAN Write Excel
Message-Id: <45a5b795$0$9569$4c368faf@roadrunner.com>
Gallon wrote:
> I have MS Excel spreadsheets with tons of formulas and data already in
> them, so I was very excited about discovering
> "Spreadsheet::WriteExcel". This would allow me to write data directly
> from my Perl scripts, rather than cutting and pasting. The only
> drawback, except for me being an idiot or a luddite, is the module only
> seems to have a "new" constructor! I need an "open" constructor, or
> whatever. Does anyone know how I might do this???
...
> Gregg Allen
>
So far as I know, Spreadsheet::WriteExcel does exactly what it says: it
writes Excel files. It doesn't read them or update them.
Spreadsheet::ParseExcel will read Excel files. Between the two, you
might be able to accomplish an update. I recommend, though, that you
check out the Win32::OLE module. It is more suitable for updating Excel
spreadsheets. There are Excel examples in the module documentation that
will get you started.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 10 Jan 2007 18:19:40 -0600
From: Billy Patton <bpatton@ti.com>
Subject: Devel::Cover How to get a more indepth report
Message-Id: <eo3vqv$40a$1@home.itg.ti.com>
I can run and get a report telling me a percentage of lines covered and
times spent in each module.
How do I get a line by line reference to each file.
I would like to know which lines did not get touched.
I used a coverage long ago that put ** infromt of each line used and
empty when not used. This is what I'm afer.
------------------------------
Date: 11 Jan 2007 02:18:10 GMT
From: xhoster@gmail.com
Subject: Re: Fine grained time
Message-Id: <20070110212011.501$qp@newsreader.com>
Mark Seger <Mark.Seger@hp.com> wrote:
> I have some code I had written awhile back (on perl 5.6 and redhat 9)
> that used ualarm to wake me up every second and it worked really nicely.
> However I've more recently dug into just how accurate that timer is
> and was disappointed, especially on a cominaction of rhel4/u4 and perl
> 5.8.5. In fact, I see my code waking up almost 0.001 seconds later on
> each subsequent interval.
>
> Going back and rereading the manpage for Time:HiRes I spotted a comment
> that the relationship between sigalarm and sleep are unspecified so I
> changed my code to use setitimer() and it behaves the same way.
>
> So my question is, is this a perl thing or a system thing? Or am I just
> doing something silly. Here's what my code looks like:
I "strace"d your program, and it looks to me like a system thing. Perl
just passes the setitimer directly on to the system, and from then on it is
up to the system to deliver the signals.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Thu, 11 Jan 2007 05:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jan 11 2007
Message-Id: <JBovuC.zJD@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Apache-SWIT-0.2
http://search.cpan.org/~bosu/Apache-SWIT-0.2/
mod_perl based application server with integrated testing.
----
Apache-iTunes-0.10
http://search.cpan.org/~bdfoy/Apache-iTunes-0.10/
control iTunes from mod_perl
----
B-Deobfuscate-0.17
http://search.cpan.org/~jjore/B-Deobfuscate-0.17/
Deobfuscate source code
----
Bundle-BDFOY-20070101
http://search.cpan.org/~bdfoy/Bundle-BDFOY-20070101/
install all modules by BDFOY
----
Business-ISBN-1.84
http://search.cpan.org/~bdfoy/Business-ISBN-1.84/
work with International Standard Book Numbers
----
Business-ISBN-Data-1.13
http://search.cpan.org/~bdfoy/Business-ISBN-Data-1.13/
data pack for Business::ISBN
----
Business-ISMN-1.10
http://search.cpan.org/~bdfoy/Business-ISMN-1.10/
work with International Standard Music Numbers
----
Business-US-USPS-WebTools-1.06
http://search.cpan.org/~bdfoy/Business-US-USPS-WebTools-1.06/
Use the US Postal Service Web Tools
----
Chemistry-Elements-1.03
http://search.cpan.org/~bdfoy/Chemistry-Elements-1.03/
Perl extension for working with Chemical Elements
----
CopyRecord-0.001
http://search.cpan.org/~jackb/CopyRecord-0.001/
Perl module for copying records in databases within same table including all child tables;
----
Crypt-Rijndael-0.06_10
http://search.cpan.org/~bdfoy/Crypt-Rijndael-0.06_10/
Crypt::CBC compliant Rijndael encryption module
----
Crypt-Rijndael-1.01
http://search.cpan.org/~bdfoy/Crypt-Rijndael-1.01/
Crypt::CBC compliant Rijndael encryption module
----
DBIx-Class-FromSledge-0.01
http://search.cpan.org/~nekokak/DBIx-Class-FromSledge-0.01/
Update or Insert DBIx::Class data using from Sledge
----
DBIx-Class-FromSledge-0.02
http://search.cpan.org/~nekokak/DBIx-Class-FromSledge-0.02/
Update or Insert DBIx::Class data using from Sledge
----
DBIx-Class-FromSledge-0.03
http://search.cpan.org/~nekokak/DBIx-Class-FromSledge-0.03/
Update or Insert DBIx::Class data using from Sledge
----
DBIx-CopyRecord-0.001
http://search.cpan.org/~jackb/DBIx-CopyRecord-0.001/
Perl module for copying records in databases within same table including all child tables;
----
Devel-Cover-0.61
http://search.cpan.org/~pjcj/Devel-Cover-0.61/
Code coverage metrics for Perl
----
File-Find-Closures-1.05
http://search.cpan.org/~bdfoy/File-Find-Closures-1.05/
functions you can use with File::Find
----
HTTP-Cookies-Mozilla-1.10
http://search.cpan.org/~bdfoy/HTTP-Cookies-Mozilla-1.10/
Cookie storage and management for Mozilla
----
HTTP-Cookies-Omniweb-1.09
http://search.cpan.org/~bdfoy/HTTP-Cookies-Omniweb-1.09/
Cookie storage and management for Omniweb
----
HTTP-Cookies-Safari-1.12
http://search.cpan.org/~bdfoy/HTTP-Cookies-Safari-1.12/
Cookie storage and management for Safari
----
HTTP-Cookies-iCab-1.09
http://search.cpan.org/~bdfoy/HTTP-Cookies-iCab-1.09/
Cookie storage and management for iCab
----
HTTP-SimpleLinkChecker-1.13
http://search.cpan.org/~bdfoy/HTTP-SimpleLinkChecker-1.13/
Check the HTTP response code for a link
----
HTTP-Size-1.12
http://search.cpan.org/~bdfoy/HTTP-Size-1.12/
Get the byte size of an internet resource
----
Kwalify-1.13
http://search.cpan.org/~srezic/Kwalify-1.13/
Kwalify schema for data structures
----
LaTeX-Pod-0.08
http://search.cpan.org/~schubiger/LaTeX-Pod-0.08/
Transform LaTeX source files to POD (Plain old documentation)
----
Mac-Errors-1.13
http://search.cpan.org/~bdfoy/Mac-Errors-1.13/
constants for Mac error codes
----
Mac-Path-Util-0.24
http://search.cpan.org/~bdfoy/Mac-Path-Util-0.24/
convert between darwin and Mac paths
----
Mac-PropertyList-1.30
http://search.cpan.org/~bdfoy/Mac-PropertyList-1.30/
work with Mac plists at a low level
----
Math-NoCarry-1.10
http://search.cpan.org/~bdfoy/Math-NoCarry-1.10/
Perl extension for no carry arithmetic
----
Net-Amazon-0.36
http://search.cpan.org/~boumenot/Net-Amazon-0.36/
Framework for accessing amazon.com via SOAP and XML/HTTP
----
Net-MAC-Vendor-1.17
http://search.cpan.org/~bdfoy/Net-MAC-Vendor-1.17/
look up the vendor for a MAC
----
Net-SIP-0.1
http://search.cpan.org/~sullr/Net-SIP-0.1/
Framework SIP (Voice Over IP, RFC3261)
----
Net-TiVo-0.06
http://search.cpan.org/~boumenot/Net-TiVo-0.06/
Perl interface to TiVo.
----
Netscape-Bookmarks-1.94
http://search.cpan.org/~bdfoy/Netscape-Bookmarks-1.94/
parse, manipulate, or create Netscape Bookmarks files
----
Object-Iterate-1.10
http://search.cpan.org/~bdfoy/Object-Iterate-1.10/
iterators for objects that know the next element
----
PAR-0.970_01
http://search.cpan.org/~smueller/PAR-0.970_01/
Perl Archive Toolkit
----
Palm-Magellan-NavCompanion-0.51
http://search.cpan.org/~bdfoy/Palm-Magellan-NavCompanion-0.51/
access the Magellan GPS Companion waypoints file
----
Polyglot-0.13
http://search.cpan.org/~bdfoy/Polyglot-0.13/
a little language interpreter
----
Set-CrossProduct-1.9
http://search.cpan.org/~bdfoy/Set-CrossProduct-1.9/
work with the cross product of two or more sets
----
Statistics-Smoothing-SGT-2.0.7
http://search.cpan.org/~bjoernw/Statistics-Smoothing-SGT-2.0.7/
A Simple Good-Turing (SGT) smoothing implementation
----
Statistics-Smoothing-SGT-2.0.8
http://search.cpan.org/~bjoernw/Statistics-Smoothing-SGT-2.0.8/
A Simple Good-Turing (SGT) smoothing implementation
----
Test-Data-1.20
http://search.cpan.org/~bdfoy/Test-Data-1.20/
test functions for particular variable types
----
Test-Env-1.07
http://search.cpan.org/~bdfoy/Test-Env-1.07/
test the environment
----
Test-File-1.18
http://search.cpan.org/~bdfoy/Test-File-1.18/
test file attributes
----
Test-HTTPStatus-1.06
http://search.cpan.org/~bdfoy/Test-HTTPStatus-1.06/
check an HTTP status
----
Test-ISBN-1.09
http://search.cpan.org/~bdfoy/Test-ISBN-1.09/
Check International Standard Book Numbers
----
Test-Prereq-1.032
http://search.cpan.org/~bdfoy/Test-Prereq-1.032/
check if Makefile.PL has the right pre-requisites
----
Test-URI-1.06
http://search.cpan.org/~bdfoy/Test-URI-1.06/
Check Uniform Resource Identifiers
----
Text-Restructured-0.003020
http://search.cpan.org/~nodine/Text-Restructured-0.003020/
----
Tie-Cycle-1.14
http://search.cpan.org/~bdfoy/Tie-Cycle-1.14/
Cycle through a list of values via a scalar.
----
Tie-Toggle-1.07
http://search.cpan.org/~bdfoy/Tie-Toggle-1.07/
False and true, alternately, ad infinitum.
----
Time-Human-1.03
http://search.cpan.org/~jhoblitt/Time-Human-1.03/
Convert localtime() format to "speaking clock" time
----
Verilog-Perl-2.370
http://search.cpan.org/~wsnyder/Verilog-Perl-2.370/
----
version-0.69
http://search.cpan.org/~jpeacock/version-0.69/
Perl extension for Version Objects
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 10 Jan 2007 17:52:23 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Parsing an XML file and adding another tag, if the tag is not available / the value is null
Message-Id: <slrneqav1n.hjk.tadmc@tadmc30.august.net>
mirod <xmltwig@gmail.com> wrote:
> On Jan 10, 10:18 am, "P" <pannb...@gmail.com> wrote:
>
>> I have a scenario in which we are adding a new tag to the existing
>> structure of the XML files, some of the new files created might have
>> the newly added tag with value / just an empty tag, all I need is to
>> add the new tag if it is not present with the value available in
>> another tag, or if it is empty have to give the value from the other
>> tag to this.
>
> Using XML::Twig here is how you would do it:
[ snip robust code that any sensible person would prefer. ]
Or if the OP is willing to live with a fragile dirty hack, then:
$xml =~ s{(.*<fname>.*?</fname>\n)(.*\n)}
{ $a = $1 . $2;
($b=$1) =~ s/fname/nickname/g;
$a . $b;
}gie;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 10 Jan 2007 16:57:46 -0800
From: "raminoacid" <raminoacid@gmail.com>
Subject: Perl DBI PostgreSQL
Message-Id: <1168477066.757349.324720@k58g2000hse.googlegroups.com>
Hi,
I'm using Perl's DBI package to connect to a PostgreSQL database.
Everything works fine except the annoying DEBUG: output for each DB
operation. This is not the same as tracing since the later can be
disabled. For instance, the following output can be seen in my
terminal:
DEBUG: InitPostgres
DEBUG: StartTransaction
DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>
DEBUG: CommitTransaction
DEBUG: name: unnamed; blockState: STARTED; state: INPROGR,
xid/subid/cid: 2082592/1/0, nestlvl: 1, children: <>
Is there anyway to disable this. I need to parse my output file and I'd
like to have a light-weight file rather a file with lots of garbage.
Thanks.
------------------------------
Date: Thu, 11 Jan 2007 01:47:51 GMT
From: "Arved Sandstrom" <asandstrom@accesswave.ca>
Subject: Re: regex
Message-Id: <bHgph.134117$YV4.111145@edtnps89>
"Abigail" <abigail@abigail.be> wrote in message
news:slrneq40v7.e59.abigail@alexandra.abigail.be...
> Arved Sandstrom (asandstrom@accesswave.ca) wrote on MMMMDCCCLXXVII
> September MCMXCIII in <URL:news:vveoh.116055$rv4.12127@edtnps90>:
> || "Abigail" <abigail@abigail.be> wrote in message
> || news:slrneq1jr9.fg.abigail@alexandra.abigail.be...
> || > lucas (lstouder@teksavvy.com) wrote on MMMMDCCCLXXVI September
> MCMXCIII
> || > in <URL:news:28e3e$45a01650$cef8bf30$16302@TEKSAVVY.COM-Free>:
> || > ^^ I have this perl oneliner that I'm using to recognize certain
> file
> || > ^^ extentions in a url. This works, but I was wondering if any of
> you
> || > know of
> || > ^^ a better way to write this.
> || > ^^
> || > ^^ echo "http://fu.bar/test.jpg" | perl -ne 'print if((/\.jpg\n$/i)|
> || > ^^ (/\.bmp\n$/i)||(/\.png\n$/i));'
> || >
> || > Yeah.
> || >
> || > echo "http://fu.bar/test.jpg"
> || >
> || > is a lot simpler.
> ||
> || I'm gathering - this is just me, mind you - that his actual input is
> not
> || manually typing in echo "http://fu.bar/test.jpg".
> ||
> || > Or did you want to ask how to grep? In that case, I'd use 'grep', not
> || > perl.
> ||
> || That works on Windows, does it?
>
>
> Well, last time I looked, Windows didn't come with perl either.
> 'grep' works on Windows, yes.
>
> But that's not the point. The user was using 'echo', pipes, and single
> quotes to delimit the Perl program. Both 'echo' and pipes are very
> Unixy things, and Windows people are always complaining that single
> quotes around a Perl one liner doesn't work on their shells.
>
> || Get over being so elitist.
>
> I don't think assuming the user is using Unix and not Windows is elitist,
> given how the user wrote his code.
Good point, one which I missed. I had a bad day that day - I recall it
clearly - and I shouldn't have even checked newsgroups. My apologies.
Arved Sandstrom
------------------------------
Date: Thu, 11 Jan 2007 02:00:01 GMT
From: "Arved Sandstrom" <asandstrom@accesswave.ca>
Subject: Re: regex
Message-Id: <BSgph.134252$YV4.94119@edtnps89>
"Paul Lalli" <mritty@gmail.com> wrote in message
news:1168227297.900277.109920@q40g2000cwq.googlegroups.com...
> Arved Sandstrom wrote:
>
>> _Using_ grep is not pretentious. Assuming that the poster is working on
>> UNIX
>> or Linux is.
>
> And assuming that any particular Windows user is too incompetant to
> download cygwin is insulting.
My apologies were made to her...him. The name throws me; I've been using
Perl since '93 or so, and I never knew, until Uri informed me just now on
this NG. I usually assume that people use real names, unless they are
obviously made up. Oh well, live and learn.
Like I said in my apology, I'd had a bad day when I wrote that (nothing to
do with work), and I was inclined to be looking for bones to pick. Mea
culpa. I can also totally not notice things in a command line that mark out
an OS, because in the course of a given working day I'm using Linux and
Windows at the same time, and I tend to mentally filter that stuff out. Now,
of course, it stands out clearly.
In any case, the apology was made, and I meant it.
I'm still not a big fan of how "Abigail" answers many questions, and I
certainly stand by my assertion that I'd not want him/her as a member of any
programming team that I'm on, except at a high consulting rate for a 2-3
hour session to shake up some programmers. That opinion is based on years of
seeing what "Abigail" posts. But it has nothing to do with my sincere
apology on this subthread.
Arved Sandstrom
------------------------------
Date: 10 Jan 2007 21:04:17 -0800
From: aaron80v@yahoo.com.au
Subject: Skip non english character values
Message-Id: <1168491857.562029.128590@p59g2000hsd.googlegroups.com>
Hi,
Occasionally the excel file I am dealing with contains non english
characters in certain fields (delimited by comma) such as Chinese,
Japanese and Korean. How do I check and skip those so that my perl
script won't break?
eg.
ABC, ??????, CDF
Right after processing ABC, I would want to jump to CDF.
Aaron
------------------------------
Date: Thu, 11 Jan 2007 06:09:00 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Skip non english character values
Message-Id: <0wkph.5153$1h.2933@trndny09>
aaron80v@yahoo.com.au wrote:
> Occasionally the excel file I am dealing with contains non english
> characters in certain fields (delimited by comma) such as Chinese,
> Japanese and Korean. How do I check and skip those so that my perl
> script won't break?
Perl is fully Unicode-capable and can handle non-English characters just
fine. If you script can handle them is a different question, of course.
I would use tr/// with the proper options (complement of English characters;
delete) to transliterate the unwanted characters into oblivion.
Having said that I think the whole idea is nuts and at least I would be
pretty upset if you would bastardize my name.
jue
------------------------------
Date: Wed, 10 Jan 2007 19:01:12 -0600
From: "Mumia W. (on aioe)" <paduille.4060.mumia.w@earthlink.net>
Subject: Re: using no strict "refs"
Message-Id: <eo4f33$ufg$1@aioe.org>
On 01/10/2007 02:59 PM, Billy Patton wrote:
>
> foreach $sub ( qw(a b c)) {
> no strict "refs";
> Pkg::${sub}(); <<<<< line 11
"Pkg::$sub"->();
> }
>
> [...]
HTH
--
paduille.4060.mumia.w@earthlink.net
Windows Vista and your
freedom in conflict: http://www.badvista.org/
http://home.earthlink.net/~mumia.w.18.spam/
------------------------------
Date: 11 Jan 2007 01:49:21 GMT
From: xhoster@gmail.com
Subject: Re: Working with array references
Message-Id: <20070110205122.790$Hw@newsreader.com>
Frederik Vanderstraeten <frederik_vanderstraeten@yahoo.co.uk> wrote:
> xhoster@gmail.com schreef:
> > Frederik Vanderstraeten <frederik_vanderstraeten@yahoo.co.uk> wrote:
> >> Hi
> >>
> >> I'm new to Perl. I have a question about array references: what's the
> >> best way to use them? How do I add an element, remove an element, ...
> >> Is dereferencing the best way?
> >> E.g., what is the easiest way to rewrite this:
> >>
> >> $arrayRef = $obj->get('myArray');
> >> @array = $@arrayRef;
> >> @array = (@array, 'newElement');
> >> $obj->set('myArray', \@array);
> >>
> >> As get returns a reference, I assume I could easily do all of this in
> >> one statement.
> >
> > I think the right way is for $obj to provide a "push" method for you to
> > use. Otherwise, what is the point of using encapsulation?
> >
> > Xho
> >
>
> It's a session object. (CGI::Session. This in fact uses param() for both
> get and set but this is only example code and it's easier to understand
> with get and set IMHO.) It is not specifically designed to store arrays.
From the source of CGI::Session, It looks like you can't just do this:
push @{$cgi_ses->param("name")}, "foo";
Because that would bypass the _set_status(STATUS_MODIFIED) and lead to
potential flushing problems. This probably should be better documented by
CGI::Session.
So the safest thing to do would be like what you did above, make a copy
of the referenced array, modify the copy, and store. I'd do it more
compactly:
$arrayRef = $obj->param('myArray');
$obj->param('myArray', [@$arrayRef,'new_element']);
Or even:
$obj->param('myArray', [@{$obj->param('myArray')},'new_element']);
In both cases, the param has to already exist and already be an arrayref.
But if I had to do a lot of this, I would just subclass CGI::Session and
add a "push" method to it. (Actually, I'd probably just add a push method
directly to CGI::Session without subclassing, but I'm ashamed to admit
that in public.)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 13
*************************************