[29282] in Perl-Users-Digest
Perl-Users Digest, Issue: 526 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 17 06:10:13 2007
Date: Sun, 17 Jun 2007 03:09:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 17 Jun 2007 Volume: 11 Number: 526
Today's topics:
Re: 12 hour clock and offset problem <purlgurl@purlgurl.net>
Re: 12 hour clock and offset problem <dbroda@gmail.com>
Re: 12 hour clock and offset problem <paduille.4061.mumia.w+nospam@earthlink.net>
Re: could XML::Simple handling chinese character? asimsuter@hotmail.com
Re: could XML::Simple handling chinese character? <mirod@xmltwig.com>
Re: could XML::Simple handling chinese character? <havel.zhang@gmail.com>
Re: could XML::Simple handling chinese character? <paduille.4061.mumia.w+nospam@earthlink.net>
Re: Get the piece of code in perl asimsuter@hotmail.com
Re: How to check the perl's syntax error before runing asimsuter@hotmail.com
Re: How to check the perl's syntax error before runing <jurgenex@hotmail.com>
Re: Need help reading two-dimentional array from a file asimsuter@hotmail.com
new CPAN modules on Sun Jun 17 2007 (Randal Schwartz)
Re: perl and php asimsuter@hotmail.com
Re: The Concepts and Confusions of Prefix, Infix, Postf <timr@probo.com>
Re: tool that does inlining of all used packages ? asimsuter@hotmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 Jun 2007 21:40:19 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <rPKdndDgAJKlJunbnZ2dnUVZ_s-rnZ2d@giganews.com>
Kenetic wrote:
(snipped)
> I'm trying to convert an input time to the offset time in a 12 hour
> clock system. It's giving me a headache. The am and pm must be the
> right ones when the offset is added to the input time ($temptime).
> In short, 10:00 am with an offset of -3 should result in 1:00 pm;
> 10:00 pm with an offset of -3 should result in 1:00 am.
Here is another method quite different from my previous
generic method which works with scalar time. This method
addresses your specific task.
This method is fast and efficient being based on index()
substr() and tr() functions. Those three functions are
amongst the more efficient perl core functions.
A walk through,
Copy out the original hour
IF original hour is 12
subtract 9 (plus 3 hours minus 12 hours)
copy in new hour without changing am nor pm
ELSE
add 3 to original hour
IF new hour equals 12
copy in new hour
IF time is pm
change pm to am
ELSE
change am to pm
ELSE IF new hour is greater than 12
subtract 12 hours
IF time is pm
change pm to am
ELSE
change am to pm
ELSE
copy in new hour without changing am nor pm
PRINT new time
#!perl
$time = "12:00 am";
$hour = substr ($time, 0, index ($time, ":"));
if ($hour == 12)
{
$hour -= 9;
substr ($time, 0, index ($time, ":"), "$hour");
}
else
{
$hour += 3;
if ($hour == 12)
{
substr ($time, 0, index ($time, ":"), "$hour");
if (index ($time, "pm") > -1)
{ $time =~ tr/p/a/; }
else
{ $time =~ tr/a/p/; }
}
elsif ($hour > 12)
{
$hour -= 12;
substr ($time, 0, index ($time, ":"), $hour);
if (index ($time, "pm") > -1)
{ $time =~ tr/p/a/; }
else
{ $time =~ tr/a/p/; }
}
else
{ substr ($time, 0, index ($time, ":"), $hour); }
}
print $time;
Let me know if you find any glitches.
--
Purl Gurl
--
"Then again what can you expect from a fat-assed, champagne swilling,
half-breed just off the Rez?"
- Joe Kline
------------------------------
Date: Sun, 17 Jun 2007 07:48:19 -0000
From: Kenetic <dbroda@gmail.com>
Subject: Re: 12 hour clock and offset problem
Message-Id: <1182066499.310400.11450@i13g2000prf.googlegroups.com>
On Jun 16, 9:40 pm, Purl Gurl <purlg...@purlgurl.net> wrote:
>
> Let me know if you find any glitches.
>
> --
> Purl Gurl
> --
It looks like it works particularly with 12 am and 12 pm, and since
you have a handle on the script (there are some things in here I
haven't used extensively--just a novice at perl), I wonder if you can
modify it to include, .5 of an hour. The offset can be -3 or -3.5 for
3 hours and 30 minutes. Also to be considered is how :30 past the hour
would then wrap around to the next hour, which is easy enough
(although when wrapping past 12 am or pm might pose a challenge)
Thanks for all the help so far, it's been overwhelming.
Cheers,
------------------------------
Date: Sun, 17 Jun 2007 08:47:09 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <hy6di.2064$ZY1.1522@newsread2.news.pas.earthlink.net>
On 06/17/2007 02:48 AM, Kenetic wrote:
>
> It looks like it works particularly with 12 am and 12 pm, and since
> you have a handle on the script (there are some things in here I
> haven't used extensively--just a novice at perl), I wonder if you can
> modify it to include, .5 of an hour. [...]
As the others have said, use already-made modules for this sort of
thing. The module writers have already worked out most of the complexities.
Is something like this what you're trying to do?
require Date::Parse;
require POSIX;
Date::Parse->import(qw/str2time/);
POSIX->import(qw/strftime mktime/);
local $\ = "\n";
my $offset = -3;
my $data = 'June 10, 2007 10:00am';
my $timeval = str2time($data)-($offset*3600);
print strftime('%F %r',localtime $timeval);
On my system (Perl 5.8.4, Linux), this prints "2007-06-10 01:00:00 PM"
Date::Parse is a very useful CPAN module, and POSIX is part of Perl.
------------------------------
Date: Sat, 16 Jun 2007 21:34:38 -0700
From: asimsuter@hotmail.com
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <1182054878.970159.103100@a26g2000pre.googlegroups.com>
On Jun 16, 8:55 pm, "havel.zhang" <havel.zh...@gmail.com> wrote:
> hi everyone:
>
> I found XML::Simple can not handling chinese character. for example:
> part1.xml:
> <?xml version=3D"1.0" encoding=3D"utf-8"?>
> <config>
> <user>=BA=CD=C6=BD</user>
> <passwd>longNails</passwd>
> <books>
> <book author=3D"Steinbeck" title=3D"Cannery Row"/>
> <book author=3D"Faulkner" title=3D"Soldier's Pay"/>
> <book author=3D"Steinbeck" title=3D"East of Eden"/>
> </books>
> </config>
>
> ----------------------------------------
> my program:
>
> #!/usr/bin/perl -w
> use strict;
> use XML::Simple;
> use Data::Dumper;
> print Dumper (XML::Simple->new()->XMLin('part1.xml',ForceArray =3D>
> 1,KeepRoot =3D> 1));
> ----------------------------------------
> then the result is:
>
> >not well-formed (invalid token) at line 2, column 8, byte 17 at C:/Perl/=
site/lib/XML/Parser.pm line 187
>
> so it's just because of chinese character.
>
> anyone can help me? thank you:)
>
> havel
Try XML::Parser
from http://search.cpan.org/~msergeant/XML-Parser/Parser.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
XML documents may be encoded in character sets other than Unicode as
long as they may be mapped into the Unicode character set. Expat has
further restrictions on encodings. Read the xmlparse.h header file in
the expat distribution to see details on these restrictions.
Expat has built-in encodings for: UTF-8, ISO-8859-1, UTF-16, and US-
ASCII. Encodings are set either through the XML declaration encoding
attribute or through the ProtocolEncoding option to XML::Parser or
XML::Parser::Expat.
For encodings other than the built-ins, expat calls the function
load_encoding in the Expat package with the encoding name. This
function looks for a file in the path list
@XML::Parser::Expat::Encoding_Path, that matches the lower-cased name
with a '.enc' extension. The first one it finds, it loads.
If you wish to build your own encoding maps, check out the
XML::Encoding module from CPAN.
AUTHORS
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Regards.
Asim Suter
asimsuter@hotmail.com
------------------------------
Date: Sun, 17 Jun 2007 07:01:55 +0200
From: mirod <mirod@xmltwig.com>
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <4674c045$0$16041$5fc30a8@news.tiscali.it>
havel.zhang wrote:
> hi everyone:
>
> I found XML::Simple can not handling chinese character. for example:
> part1.xml:
> <?xml version="1.0" encoding="utf-8"?>
> <config>
> <user>ºÍƽ</user>
> </config>
> #!/usr/bin/perl -w
> use strict;
> use XML::Simple;
> use Data::Dumper;
> print Dumper (XML::Simple->new()->XMLin('part1.xml',ForceArray =>
> 1,KeepRoot => 1));
> ----------------------------------------
> then the result is:
>> not well-formed (invalid token) at line 2, column 8, byte 17 at C:/Perl/site/lib/XML/Parser.pm line 187
>
> so it's just because of chinese character.
Actually the example works perfectly on my machine. There must be
something either in the format of your file (but I copied it as is, so I
can't see what could cause a problem there) or something in your
environment. What versions of perl, XML:::Simple, but also the parser
(XML::Parser in your case, but if you installed XML::LibXML it would be
used instead) are you using?
--
mirod
------------------------------
Date: Sat, 16 Jun 2007 23:10:42 -0700
From: "havel.zhang" <havel.zhang@gmail.com>
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <1182060642.661637.225640@o11g2000prd.googlegroups.com>
On 6=D4=C217=C8=D5, =CF=C2=CE=E71=CA=B101=B7=D6, mirod <m...@xmltwig.com> w=
rote:
> havel.zhang wrote:
> > hi everyone:
>
> > I found XML::Simple can not handling chinese character. for example:
> > part1.xml:
> > <?xml version=3D"1.0" encoding=3D"utf-8"?>
> > <config>
> > <user>=BA=CD=C6=BD</user>
> > </config>
> > #!/usr/bin/perl -w
> > use strict;
> > use XML::Simple;
> > use Data::Dumper;
> > print Dumper (XML::Simple->new()->XMLin('part1.xml',ForceArray =3D>
> > 1,KeepRoot =3D> 1));
> > ----------------------------------------
> > then the result is:
> >> not well-formed (invalid token) at line 2, column 8, byte 17 at C:/Per=
l/site/lib/XML/Parser.pm line 187
>
> > so it's just because of chinese character.
>
> Actually the example works perfectly on my machine. There must be
> something either in the format of your file (but I copied it as is, so I
> can't see what could cause a problem there) or something in your
> environment. What versions of perl, XML:::Simple, but also the parser
> (XML::Parser in your case, but if you installed XML::LibXML it would be
> used instead) are you using?
>
> --
> mirod- =D2=FE=B2=D8=B1=BB=D2=FD=D3=C3=CE=C4=D7=D6 -
>
> - =CF=D4=CA=BE=D2=FD=D3=C3=B5=C4=CE=C4=D7=D6 -
hi mirod:
when i changed chinese character with english word, it works fine.
my versions of perl is 5.8.8 .
havel
------------------------------
Date: Sun, 17 Jun 2007 08:09:59 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <r%5di.706$iz5.356@newsread4.news.pas.earthlink.net>
On 06/17/2007 01:10 AM, havel.zhang wrote:
>
> hi mirod:
> when i changed chinese character with english word, it works fine.
> my versions of perl is 5.8.8 .
>
> havel
>
I also ran your program without problems on Perl 5.8.4 / Linux. You
should enable a utf8 locale on your computer and tell Perl to use that
encoding when reading from the file.
When I tested your program, I first saved part1.xml to a file in utf8
format; then I copied your script to a file in utf8 format. I also added
the "encoding" pragma to tell Perl that the script was written in utf8.
And my locale is currently set to utf8.
So there's no way for Perl to be unprepared to deal with utf8 encoded
data on my system right now, and Chinese characters should be stored in
either utf8 or gb2312 files.
I suspect your problem is encoding confusion. Either you don't have a
suitable locale installed (e.g. utf8), or you stored the file in one
encoding (e.g. gb2312), but you're trying to read it in another encoding
(utf8 ?).
------------------------------
Date: Sat, 16 Jun 2007 22:00:20 -0700
From: asimsuter@hotmail.com
Subject: Re: Get the piece of code in perl
Message-Id: <1182056420.446057.49460@j4g2000prf.googlegroups.com>
On Jun 14, 5:37 am, Paul Lalli <mritty@gmail.com> wrote:
> On Jun 14, 8:14 am, Maruthi Reddy <mhm.re...@gmail.com> wrote:
>
>
>
> > Hi All,
>
> > I want to get the pieces of code from the contents of file.
> > I can push the file contents into the array, But not getting some to
> > way to get the required piece of code.
>
> > My file looks something like
>
> > -------------------File start-------------------
> > .............. ............. ... ... .............
> > ................ ..... ........ ........... ......
> > AAA..... ............. ............. .........
> > .............. .......... ............. .......
> > BBB ........ ........... ........ ...........
> > ........... .......... .......... ...............
> > ...... .......... .......... ........... ..........
> > AAA .... ........... .......... ............ .
> > .......... ........ .............................
> > .............................. ..............
> > BBB ...........................................
> > ............................. ........... .....
> > ----------------------File end ----------------
>
> > Here i would like to get the piecc of code between AAA and BBB.
> > Please suggest me.
>
> There's about 10 different ways to do this. Here's one:
>
> my $file = do { local $/; <DATA> };
> my @codes = ($file =~ /AAA(.*?)BBB/sg);
> foreach $code (@codes) {
> print "$code\n\n";
>
> }
>
> Paul Lalli
I am pasting some code below that needed a similar thing. Hope its
useful to you. Note m modifier for multiline search which is a key
element.
Regards.
Asim Suter
asimsuter@hotmail.com
my $MATCH = qq<$STR(.*?)endif> ; # non-greedy matching
if( $whole_file =~ m/$MATCH/msg ) # g for pos
{
my $inter = $1 ;
my $TO_ADD = $ADD . $inter . "\nendif\n" ;
print "$TO_ADD" ;
my $p = pos $whole_file ;
print "POSITION:<$p>" ;
my $NEW_FILE_CONTENT = substr ( $whole_file , 0 , $p ) .
"\n\n" .
$TO_ADD .
substr ( $whole_file , $p ) ;
seek( FH , 0, 0 ) or die "Can't seek to
start of \"$fileName\": $!" ;
print FH $NEW_FILE_CONTENT or die "Can't print to
\"$fileName\": $!" ;
truncate ( FH , tell(FH) ) or die "Can't truncate
\"$fileName\": $!" ;
print LOGFILE "MODIFYING <$fileName>\n" ;
}
------------------------------
Date: Sat, 16 Jun 2007 22:15:21 -0700
From: asimsuter@hotmail.com
Subject: Re: How to check the perl's syntax error before runing the code?
Message-Id: <1182057321.448622.158650@g37g2000prf.googlegroups.com>
On Jun 13, 10:04 pm, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> sonet wrote:
> > How to check the perl's syntax error but does not execute it?
>
> Trivial. Did you check the documentation of perl?
> From "perldoc perlrun":
> -c causes Perl to check the syntax of the program and then exit
> without executing it. [...]
>
> jue
There are cases where -c will say that syntax is OK yet it will fail
at runtime.
Classic cases:
1) missing 'use Library'
2) missing sub Function definition.
Regards.
Asim Suter
asimsuter@hotmail.com
------------------------------
Date: Sun, 17 Jun 2007 09:07:18 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to check the perl's syntax error before runing the code?
Message-Id: <aR6di.4119$gI4.2813@trndny06>
asimsuter@hotmail.com wrote:
> On Jun 13, 10:04 pm, "Jürgen Exner" <jurge...@hotmail.com> wrote:
>> sonet wrote:
>>> How to check the perl's syntax error but does not execute it?
>>
>> Trivial. Did you check the documentation of perl?
>> From "perldoc perlrun":
>> -c causes Perl to check the syntax of the program and then exit
>> without executing it. [...]
>>
>> jue
>
>
> There are cases where -c will say that syntax is OK yet it will fail
> at runtime.
>
> Classic cases:
>
> 1) missing 'use Library'
> 2) missing sub Function definition.
Neither is a syntax issue and the OP explicitely asked for a syntax check.
jue
------------------------------
Date: Sat, 16 Jun 2007 21:43:15 -0700
From: asimsuter@hotmail.com
Subject: Re: Need help reading two-dimentional array from a file
Message-Id: <1182055395.912444.115200@a26g2000pre.googlegroups.com>
my @foo = eval do { local $/; <DATA>} ;
I hear in Perl6 they are coming up with a new inbuilt for above called
'slurp'
Regards.
Asim Suter
asimsuter@hotmail.com
On Jun 14, 12:00 pm, Paul Lalli <mri...@gmail.com> wrote:
> On Jun 14, 2:39 pm, DanchikPU <danc...@gmail.com> wrote:
>
>
>
> > I am attempting to read in two-dimentional array from a file,
> > but my data is being treated as a flat array.
>
> > The data file looks something like this:
>
> > (['abcd','qwerty','L','1234'],
> > ['abce','qwerty','L','1234'],
> > ['abcf','qwerty','L','1234'],
> > ['abcg','qwerty','L','1234']);
>
> > In the code, I am doing to standart
>
> > open(DATA, "foo.txt")
> > @foo=<DATA>
> > close(DATA);
>
> > Accessor $foo[0] will return the first line, but $foo[0][0]
> > fails
>
> > The data is formatted perfectly, I have tried pasting it
> > directly into the code and everything works, it's only when I
> > try to read it in that I fail.
>
> '[' and ']' and ',' mean absolutely nothing special in text. They
> only mean anything in code. Perl has no way of knowing that you
> wanted the text you read from the file to act as though it was
> actually typed into your program.
>
> There are many solutions I can think of off the top of my head:
> 1) Parse the file looking for your data files and build your 2-
> dimensional array.
> 2) Use eval() to treat the text as Perl code
> 3) Change how you're creating the file to begin with.
>
> Here's a few examples of each solution:
> 1)
> #!/usr/bin/perl
> use strict;
> use warnings;
> my @foo;
> while (<DATA>){
> my @values = /'(.*?)'/g;
> push @foo, \@values;
>
> }
>
> 2)
> #!/usr/bin/perl
> use strict;
> use warnings;
> my @foo = eval do { local $/; <DATA>} ;
>
> 3)
> Program that creates the file:
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Storable;
> my @foo;
> #populate @foo
> store(\@foo, 'foo.txt');
> __END__
>
> Program that reads the file:
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Storable;
> my @foo = @{ retrieve('foo.txt') };
>
> Please take EXTREME CAUTION with method #2. If you're not 100% sure
> you know exactly what the contents of that file are, you're opening
> yourself up to a massive security hole. That method will execute ANY
> perl code found in the file. Including code that might contain, for
> example:
> system("rm -rf /");
>
> Paul Lalli
------------------------------
Date: Sun, 17 Jun 2007 04:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jun 17 2007
Message-Id: <JJrJqC.1wBI@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.
AI-Pathfinding-AStar-0.08
http://search.cpan.org/~acdalton/AI-Pathfinding-AStar-0.08/
Perl implementation of the A* pathfinding algorithm
----
AI-Pathfinding-AStar-0.09
http://search.cpan.org/~acdalton/AI-Pathfinding-AStar-0.09/
Perl implementation of the A* pathfinding algorithm
----
Date-Gregorian-0.10
http://search.cpan.org/~mhasch/Date-Gregorian-0.10/
Gregorian calendar
----
Device-SerialPort-1.002001
http://search.cpan.org/~cook/Device-SerialPort-1.002001/
Linux/POSIX emulation of Win32::SerialPort functions.
----
FCGI-Spawn
http://search.cpan.org/~veresc/FCGI-Spawn/
process manager/application server for FastCGI protocol.
----
FCGI-Spawn-0.1
http://search.cpan.org/~veresc/FCGI-Spawn-0.1/
process manager/application server for FastCGI protocol.
----
Java-Javap-0.01
http://search.cpan.org/~philcrow/Java-Javap-0.01/
Java to Perl 6 API translator
----
Module-DevAid-0.2201
http://search.cpan.org/~rubykat/Module-DevAid-0.2201/
tools to aid perl module developers
----
Net-Daemon-0.42
http://search.cpan.org/~mnooning/Net-Daemon-0.42/
Perl extension for portable daemons
----
Net-OICQ-1.6
http://search.cpan.org/~tangent/Net-OICQ-1.6/
Perl extension for QQ instant messaging protocol
----
Regexp-Wildcards-0.02
http://search.cpan.org/~vpit/Regexp-Wildcards-0.02/
Converts wildcards expressions to Perl regular expressions.
----
Tie-File-FixedRecLen-0.4
http://search.cpan.org/~oliver/Tie-File-FixedRecLen-0.4/
Fixed Length Record support for Tie:File
----
X10-Home-0.01
http://search.cpan.org/~mschilli/X10-Home-0.01/
Configure X10 for your Home
----
XML-Bare-0.05
http://search.cpan.org/~codechild/XML-Bare-0.05/
Minimal XML parser implemented via a C++ state engine
----
XML-DTD-0.06
http://search.cpan.org/~wohl/XML-DTD-0.06/
Perl module for parsing XML DTDs
----
YAML-Syck-0.86
http://search.cpan.org/~audreyt/YAML-Syck-0.86/
Fast, lightweight YAML loader and dumper
----
YAML-Syck-0.87
http://search.cpan.org/~audreyt/YAML-Syck-0.87/
Fast, lightweight YAML loader and dumper
----
YAML-Syck-0.88
http://search.cpan.org/~audreyt/YAML-Syck-0.88/
Fast, lightweight YAML loader and dumper
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: Sat, 16 Jun 2007 22:12:15 -0700
From: asimsuter@hotmail.com
Subject: Re: perl and php
Message-Id: <1182057135.040193.114260@d30g2000prg.googlegroups.com>
On Jun 14, 1:36 pm, kra...@visto.com wrote:
> On Jun 12, 6:19 am, peter <p...@juno.com> wrote:
>
> > At one time, I did a bit of perl but now I see php alot. I was
> > wondering what you guys thinks of the pros/cons of perl and php.
>
> I am a Web Developer. It takes a lot more code in Perl than PHP to
> accomplish simple tasks.
Really ? I find them both fairly concise.
Can you give an example perhaps ?
Regards.
Asim Suter
asimsuter@hotmail.com
Some may say (in this group) PHP is geared
> towards beginners. They are wrong. PHP was created with the internet
> in mind where as Perl wasn't. In my opinion there's only one way to
> use Perl on the internet effectively and that is with mod_perl and a
> framework like Maypole or Catalyst. But that comes with a whole
> 'nother set of problems and Pros and Cons.
>
> In short... If you're developing for the internet and your only
> choices are PHP and Perl, use what you know best! If you must choose
> for other reasons... I would use PHP simply because it makes more
> sense to use the right tool for the right job. Afterall, it was made
> for that purpose. But really if you're looking for a JOB you may want
> to take a look at ASP+C#.
------------------------------
Date: Sun, 17 Jun 2007 05:40:13 GMT
From: Tim Roberts <timr@probo.com>
Subject: Re: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Functional Notations
Message-Id: <t0i9731rqonu09k48iav32jaofde5o2186@4ax.com>
"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
>
>The grammar of perl hasn't changed much since perl 5.0, which was
>released in 1994. There were a few minor additions, but just about every
>perl 5.0 script would still run with perl 5.8.x.
>
>Try getting to run 13 year old C++ code with a current compiler some
>time ...
What?? I would be very surprised to find ANY 13-year-old C++ code that did
not compile error-free on a modern compiler. The standard library has
changed significantly, and the template syntax has evolved, but I can't
think of any old syntax that is no longer valid.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
------------------------------
Date: Sat, 16 Jun 2007 22:36:22 -0700
From: asimsuter@hotmail.com
Subject: Re: tool that does inlining of all used packages ?
Message-Id: <1182058582.561931.140500@n15g2000prd.googlegroups.com>
You could use
perl -d:Trace program
and perhaps save it in a file ?
Asim Suter
On Jun 10, 2:53 pm, Yakov <iler...@gmail.com> wrote:
> Which tool does inlining of all used packages ?
>
> I saw some such tool in use in spamd installation.
> The resulting perl code has no external dependencies.
>
> Is this preprocessor generic or spamd-specific ?
> Is it on cpan ? What's its name ?
>
> The preprocessor used in spamd installation inlines all packages
> and rewrites the code so that the resulting perl code only
> remotely resembles the original.
>
> Thanks
> Yakov
------------------------------
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 526
**************************************