[23288] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5508 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 16 00:05:53 2003

Date: Mon, 15 Sep 2003 21:05:06 -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           Mon, 15 Sep 2003     Volume: 10 Number: 5508

Today's topics:
    Re: Crypt::SSLeay <kalinabears@iinet.net.au>
        dbi:csv browsing script (Joseph)
        Help with Net::IRC <ccampora@anakena.dcc.uchile.cl>
    Re: Help with Net::IRC <usenet-harvested@asgardnet.org>
        Inconsistent behaviour of empty "while" EXPR <clyde@nohamorspamgetofftheline.freeservenohamorspam.co.uk.nohamorspam>
    Re: Inconsistent behaviour of empty "while" EXPR <abigail@abigail.nl>
    Re: Installing from CPAN on Win32 <michael.p.broida@boeing.com>
        javascript=escape() perl=(looking for equiv) <wenjoh26@emNOSPAMail@pct.edu>
    Re: javascript=escape() perl=(looking for equiv) <gpatnude@adelphia.net>
    Re: javascript=escape() perl=(looking for equiv) <NOSPAM@bigpond.com>
    Re: kill command in a perl script <jgibson@mail.arc.nasa.gov>
    Re: need DBD::ODBC help <r_reidy@comcast.net>
    Re: Newbie Question: Could someone show me how to imple (Bill)
    Re: Newbie Question: Could someone show me how to imple (Jay Tilton)
    Re: Newbie Question: Could someone show me how to imple (Jay Tilton)
        Perl way to do PHP includes? <none@none.com>
    Re: Perl way to do PHP includes? <emschwar@pobox.com>
    Re: Perl way to do PHP includes? <none@none.com>
    Re: Perl way to do PHP includes? <none@none.com>
        the shoes we wear <tulwycog@yrobc.org>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 16 Sep 2003 09:22:58 +1000
From: Sisyphus <kalinabears@iinet.net.au>
Subject: Re: Crypt::SSLeay
Message-Id: <3f664a83$0$23596$5a62ac22@freenews.iinet.net.au>

A. Ma wrote:
> I am tryping to get Crypt::SSLeay to run under Windows. From CPAN, the
> documentation says that Activestate has a compiled version available
> already. Yet I cannot locate it when I went to Activestate. Does anyone know
> where I can find one? (The documentation from CPAN implied that compiling
> the module yourself is very problematic. That's why they suggested getting
> the PPM version from Activestate.)
> 
> 

If you can't find it at AS, get it from http://theoryx5.uwinnipeg.ca/

For perl 5.6:
ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/Crypt-SSLeay.ppd

For perl 5.8
ppm install http://theoryx5.uwinnipeg.ca/ppms/Crypt-SSLeay.ppd

Cheers,
Rob



------------------------------

Date: 15 Sep 2003 19:28:47 -0700
From: jcharth@hotmail.com (Joseph)
Subject: dbi:csv browsing script
Message-Id: <2f2b8b0b.0309151828.ad7784f@posting.google.com>

Hi am learning to use dbi:csv and i found a script call db_browser in
freshmeat for some reason it only works with oracle, mysql and pg.
does anyone know of a similar script that works with csv tables, or
may be a utility ? thanks.


------------------------------

Date: Tue, 16 Sep 2003 00:47:38 +0000 (UTC)
From: Cristian Alberto Campora Guajardo <ccampora@anakena.dcc.uchile.cl>
Subject: Help with Net::IRC
Message-Id: <bk5mja$tqh$1@helcaraxe.dcc.uchile.cl>

i installed the Net::IRC module, when a try to make the connection with an irc server
nothing happen, i have an adsl connection , so eth0 and ppp0 interfaces , i ran a 
netstat in my computer , and it seems to be traying to connect by eth0 devices instead 
of ppp0, my eth0 device have an internal ip adresses making NAT , it seems to me that 
the ip adresses should be the one uses by ppp0 device. I hope explain god the problem, 
if any body has idea how to resolve this please help :D 
PD: Sorry for my english it's very poor :/ 
 



------------------------------

Date: Tue, 16 Sep 2003 02:26:48 GMT
From: Ciro The Spider-Man <usenet-harvested@asgardnet.org>
Subject: Re: Help with Net::IRC
Message-Id: <slrnbmct6m.23ud.usenet-harvested@aegir.asgardnet.org>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

begin  quote: Cristian Alberto Campora Guajardo wrote:
> 
> 
> i installed the Net::IRC module, when a try to make the connection 
with an irc server
> nothing happen, i have an adsl connection , so eth0 and ppp0 
interfaces , i ran a 
> netstat in my computer , and it seems to be traying to connect by 
eth0 devices instead 
> of ppp0, my eth0 device have an internal ip adresses making NAT , it 
seems to me that 
> the ip adresses should be the one uses by ppp0 device. I hope explain 
god the problem, 
> if any body has idea how to resolve this please help :D 
> PD: Sorry for my english it's very poor :/   

If I remember correctly from when I tried to use Net::IRC a while back, 
everything I came across basically said that it had been obsoleted in 
favor of POE::Component::IRC.  

POE is kinda cool, but it takes some learning.

HTH, HAND

- -C

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.2 (FreeBSD)

iD8DBQE/ZnTduZyBAXaCR6IRAvCsAKCNbgwr9U5PxXgVLLd9i4epGUusmgCfRJGM
TJyGG+ANhAa09F0TPLKUBu0=
=836/
-----END PGP SIGNATURE-----

-- 
Email Public Key ID: A42C3DD3 domino at my domain
Usenet Public key ID: 768247A2 usenet-harvested at my domain
See headers for the value of "my domain"


------------------------------

Date: Mon, 15 Sep 2003 23:04:18 +0100
From: "Clyde Ingram" <clyde@nohamorspamgetofftheline.freeservenohamorspam.co.uk.nohamorspam>
Subject: Inconsistent behaviour of empty "while" EXPR
Message-Id: <3Jq9b.2166$966.1671@newsfep3-gui.server.ntli.net>

Odd one this:an empty EXPRession in a "while" loop seems to take a defined
value in this call from either ksh on solaris 2.6 to Perl 5.004, or Cygwin
on Win2k or Win98 to Perl 5.8.0 (ActiveState binary 806):

        perl -e 'while () { print "Aha "; }'

because it loops endlessly, printing "Aha Aha Aha Aha . . .".
Same behaviour if I beef this up into:

        perl -wTe 'use strict; while () { print "Aha "; }'

or even it I put this into a file (fred), make it executable (chmod 755
fred), and run it (perl fred).

Contrast this with:

        perl -e 'do { print "Aha "; } while ();'

which only prints "Aha " once, and then stops.
Contrast still further with:

        perl -e 'if () { print "Aha "; }'

which fails with:

        syntax error at -e line 1, near "() "
        Execution of -e aborted  due to compilation errors.

Note also, these print nothing, as expected:

        perl -e 'while (undef) { print "Aha ";  }'
        perl -e 'while ("") { print "Aha ";  }'
        perl -e 'while (0) { print "Aha ";  }'
        perl -e 'while (defined) { print "Aha ";  }'

Now the Perl manual says:

        if (EXPR) BLOCK
        . . .
        LABEL while (EXPR) BLOCK
        . . .
        The while statement executes the block as long as the expression is
true (does not evaluate to the null string "" or 0 or "0").

Can anyone explain why my very first "while ()" looped endlessly, but the
"do . . . while ()" stopped?
And should I be surprised that the "if ()" gave a syntax error instead?

Thank-you,
Clyde








------------------------------

Date: 15 Sep 2003 22:24:57 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Inconsistent behaviour of empty "while" EXPR
Message-Id: <slrnbmcf1p.cji.abigail@alexandra.abigail.nl>

Clyde Ingram
(clyde@nohamorspamgetofftheline.freeservenohamorspam.co.uk.nohamorspam) wrote on MMMDCLXVII September MCMXCIII in <URL:news:3Jq9b.2166$966.1671@newsfep3-gui.server.ntli.net>:
??  Odd one this:an empty EXPRession in a "while" loop seems to take a defined
??  value in this call from either ksh on solaris 2.6 to Perl 5.004, or Cygwin
??  on Win2k or Win98 to Perl 5.8.0 (ActiveState binary 806):
??  
??          perl -e 'while () { print "Aha "; }'
??  
??  because it loops endlessly, printing "Aha Aha Aha Aha . . .".

Yes. That's a feature (but poorly documented):

    $ perl -MO=Deparse -e 'while () {}'
    while (1) {
        ;
    }
    -e syntax OK

Here's another, similar trick:

    $ perl -MO=Deparse -e 'for (;;) {}'
    while (1) {
        ;
    }
    -e syntax OK


The latter trick comes from C.


??  Contrast this with:
??  
??          perl -e 'do { print "Aha "; } while ();'
??  
??  which only prints "Aha " once, and then stops.
??  Contrast still further with:
??  
??          perl -e 'if () { print "Aha "; }'
??  
??  which fails with:
??  
??          syntax error at -e line 1, near "() "
??          Execution of -e aborted  due to compilation errors.


Only while () BLOCK is special. Not if () BLOCK, not do BLOCK while (),
and neither EXPR while ().



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54";
print if s/<<EOT/<<EOT/e;
Just another Perl Hacker
EOT


------------------------------

Date: Mon, 15 Sep 2003 22:54:19 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: Installing from CPAN on Win32
Message-Id: <3F66431B.82FC3B72@boeing.com>

James Willmore wrote:
> 
> "Michael P. Broida" <michael.p.broida@boeing.com> wrote in message news:<3F60C5B5.2CA81791@boeing.com>...
> > Sisyphus wrote:
> > >
> > > Michael P. Broida wrote:
> <snip>
> >
> >       I looked there yesterday; LOTS and LOTS of confusing info.  :)
> >
> >       Just now tried using "LIB=" as you suggest, pointing to a new
> >       subdirectory on C:, but I get the same error: it wants to find
> >       the Perl installation on the S: drive, but ours is on T: instead.
> >
> >       Any ideas how to make it see the Perl installation on T:??
> >       Or why MakeMaker wants to see it on S:??
> 
> Just some suggestions/questions ...
> 
> Are you _sure_ the drive mappings are correct?  Something isn't fouled
> in whatever login script may be launched?  Re-map the drive just to be
> sure?
> And how about your PATH?  Is it set properly?  Have you tried to
> change it so that the only directories in there are for what you're
> trying to do?
> What do you get when you type 'perl -V'?  Is the result from this
> command expected?  @INC is what you expect it to be?
> 
> Again, just some suggestions/questions to be answered.

	No problem.  I appreciate any insights.

	Yep, the drive mappings are as expected, and have been for a long time.
	This is Win2K, so there's no "login script" launched when running a Perl
	script; and all my Perl scripts work fine.  I use that mapped drive (and
	several others) all day long for other tools as well as Perl scripts.

	The PATH is setup fine; Perl is exactly where expected, and there is no
	other Perl installation at or below any path element before or after that
	one in the PATH variable.  I haven't modified the path because there are
	paths to several critical tools in there that I can't remove without
	screwing up all of their functionality (and losing a lot of work time).
	Otherwise, it's set as minimal as I can safely make it.

	"perl -V" says a LOT of stuff.  <grin>

	Main info:
		perl5 (revision 5 version 6 subversion 0)
		osname=MSWin32
	@INC looks as expected, PERLLIB looks as expected (and fits with @INC
	content.  Both show the UNC path that corresponds to my T: mapping.

	"libpth" includes "S:\Perl\lib\CORE" which is the error I mentioned
	earlier: I don't have an "S:" drive.

	Here's one oddity that hasn't hurt my USING perl, but maybe it's a
	problem with trying to install a perl module:  Inside of "ldflags"
	for "Linker and LIbraries" (and in "lddlflags" for "Dynamic Linking"),
	there is:
		-libpath:"E:\Utils\Perl\lib\CORE"
	I don't have an "E:" drive mapped, either, so I don't know why that
	is there.  My Perl installation is on the mapped T: drive and not under
	a "Utils" directory at all.

	So, I'm still at a loss as to why Perl (including "perl -V") thinks
	our Perl installation is on S: and won't see the T: installation (that
	SOME of "perl -V" points to).

	Anyway, I've decided to go a different way with the project that started
	this whole thing.  I was trying to use Win32::GUI (from CPAN) to setup
	a simple GUI over the main Perl tool.  Due to this problem (and because
	we don't have a Java2 compiler handy), I'm building an MFC0-based GUI
	that will kick-off the Perl script to do the real work.  Thus, we can
	just let this thread die out, unless you have some further insight into
	the whole thing.  :)

		Thanks for the inputs!
			Mike


------------------------------

Date: 15 Sep 2003 22:04:32 -0500
From: john <wenjoh26@emNOSPAMail@pct.edu>
Subject: javascript=escape() perl=(looking for equiv)
Message-Id: <Xns93F7EAE0DBD83wenjoh26emNOSPAMailp@216.65.98.9>

anybody know what the per equilivent to the javascript escape() function.

thanks in advance
john


------------------------------

Date: Tue, 16 Sep 2003 03:25:14 GMT
From: "Greg Patnude" <gpatnude@adelphia.net>
Subject: Re: javascript=escape() perl=(looking for equiv)
Message-Id: <uov9b.1323$065.907693@news1.news.adelphia.net>


"john" <wenjoh26@emNOSPAMail@pct.edu> wrote in message
news:Xns93F7EAE0DBD83wenjoh26emNOSPAMailp@216.65.98.9...
> anybody know what the per equilivent to the javascript escape() function.
>
> thanks in advance
> john

quotemeta





------------------------------

Date: Tue, 16 Sep 2003 13:25:32 +1000
From: "Gregory Toomey" <NOSPAM@bigpond.com>
Subject: Re: javascript=escape() perl=(looking for equiv)
Message-Id: <bk5vtf$q2ghj$1@ID-202028.news.uni-berlin.de>

"john" <wenjoh26@emNOSPAMail@pct.edu> wrote in message
news:Xns93F7EAE0DBD83wenjoh26emNOSPAMailp@216.65.98.9...
> anybody know what the per equilivent to the javascript escape() function.
>
> thanks in advance
> john

See http://developer.irt.org/script/1505.htm

gtoomey




------------------------------

Date: Mon, 15 Sep 2003 17:52:55 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: kill command in a perl script
Message-Id: <150920031752553144%jgibson@mail.arc.nasa.gov>

In article <257137ea.0309150913.11f08d49@posting.google.com>, Hugh Kang
<skang@leaguedata.com> wrote:

> I just started learning Perl and I am trying to do followings;
> 
> ps -ef | grep java >pidfile
> In pidfile, there are 3 PIDs for weblogic processes.
> 
>     root  1769  1758   TS   0  0 17:55:26 vt02    44:38
> /opt/java2-1.3.1/bin/./../bin/x86at/native_threads/java -Xms512m
> -Xmx512m -Dweb
>     root 27464 27453   TS  29  0 09:15:55 vt04    91:55
> /opt/java2-1.3.1/bin/./../bin/x86at/native_threads/java -Xms1024m
> -Xmx1024m -Dw
>     root 27533 27522   TS  49  0 09:21:45 vt03     2:35
> /opt/java2-1.3.1/bin/./../bin/x86at/native_threads/java -Xms32m
> -Xmx200m -Dwebl
> 
> What I want is get the largest PID which is 27533 in this case, and
> then
> kill -3 the PID.
> 
> So I made a simple one for this:
> 
> #!/usr/bin/perl 
> #
> #            This is a test script to get wls managed server pid
> #
> #
> open(JAVAPIDS,"pidfile") or die "can't open input file:$!\n";
> $pidcnt=0;
> while($line=<JAVAPIDS>) {
> #  
> ($user,$pid1,$pid2,$it4,$it5,$it6,$it7,$it8,$it9,$it10,$it11,$it12,$it13,$it14,
> $it15)=split("
> ",$line);

The above line is unnecessary because of the following line.

>    ($user,$pid1)=split(" ",$line);
>    $pidfile{$pid1}=$pid1;
>    $pid_comp[$pidcnt]=$pidfile{$pid1};
> #   print "pid$pidcnt : $pid_comp[$pidcnt] \n";
>    if ($pidcnt gt 0) {  
>        if ($pid_comp[0] < $pid_comp[$pidcnt]) {
>              $pid_comp[0] = $pid_comp[$pidcnt];
>       }
>    }
>    $pidcnt++;
> 
> }
> print "pidcnt : $pidcnt \n";
> print "Largest PID for java is : $pid_comp[0] \n";   
> 
> ------------------------------------------
> 
> Q1) How do I do 'kill -3 $pid_comp[0] in this script?

   kill 3, $pid_comp[0]

See 'perldoc -f kill'

> Q2) Is there any way that I can do the followings:
> 
> In a Unix script,
> 
> ps -ef |grep java >pidfile
> 
> ./perl_script
> ...
> ...
> kill -3 $pid_comp[0]

Not easily, and not necessary because of answer to 1.

> 
> 
> Q3) Any other way to get what I want?

Yes. You can get the filtered output of the ps command using backtics:

[tested in part ("No processes were actually killed in the development
of this program")]

#!/opt/perl/bin/perl

use strict;
use warnings;

my @lines = `ps -ef|grep java`;  # <--notice backtics, not single quotes
my @pids = ();
foreach ( @lines) {
  my ($user,$pid) = split;
  push(@pids,$pid);
}
my $largest = ((sort(@pids)))[$#pids];
kill 3, $largest;

[end program]

> 
> 
> Can anyone help me out with this issue please?

Hope I have.

> 
> Many thanks in advance!
> 
> Hugh


------------------------------

Date: Mon, 15 Sep 2003 19:01:50 -0600
From: Ron Reidy <r_reidy@comcast.net>
Subject: Re: need DBD::ODBC help
Message-Id: <3F6660FE.5070906@comcast.net>

see below ...

Andrew Burton wrote:
> I'm trying to get a Linux box, with RedHat 8 and Perl 5.8.0, to connect with an
> AS400 machine through ODBC.  I'm fairly sure I can get it to connect, because I
> don't get an error until I try to use $db->prepare(). I will post the code and
> errors below.  I get two errors, but I am fairly sure the second error is a
> result of the first.  My main questions, to anyone who has written a Perl
> script/program that connects to an IBM machine, are three-fold:
> 
> 1. What am I doing wrong?
> 
> 2. Should I be using DBD::DB2?

I would.  ODBC will most likely not be as fast as the native driver for DB2.

> 
> 3. If so, what kind of drivers do I need to use DBD::DB2?

I would guess you will need to install DB2 on your linux server.

> 
> Thanks for any help, as me and my boss have spent a good bit of time digging
> through IBM sites, the Usenet, and the web.  Thanks.  Here's the bit of code
> I'm using to "prototype" a connection:
> 
> [code]
> #!/usr/bin/perl -w
> 
> use strict;
> use DBI;
> 
> my $db = DBI->connect('dbi:ODBC:AS400', 'myid', 'mypassword')  or die
> $DBI::errstr;
> 
> my $out = $db->prepare("SELECT * FROM CD02 WHERE CD02_INSTRNO = '4110'");

Your error message is too vague.  Check for success:

$db->prepare("...") || die $DBI::errstr;

> $out->execute() or die $DBI::errstr;
> 
> while (my @lala = $out->fetchrow_array()) {
>         foreach my $la (@lala) {
>                 print "$la\t";
>         }
> 
>         print "\n";
> }
> 
> exit;
> [/code]
> 
> ...and here are the errors I get:
> 
> [errors]
> DBD::ODBC::db prepare failed: [unixODBC][IBM][iSeries Access ODBC Driver][DB2
> UDB] (SQL-HY000)
> [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB] (SQL-42S02)(DBD:
> st_prepare/SQLPrepare err=-1) at ./odbctest line 8.
What is "SQL-42S02"?

> Can't call method "execute" on an undefined value at ./odbctest line 9.
> [/errors]
> 
> 
> Andrew Burton - tuglyraisin at aol dot com
> Felecia Station on Harvestgain - http://www.darkbeast.com/
> "I often question my sanity; it has yet to give me a straight answer."
> "And if you're bored, it's because... you're boring." - Matt Drudge


-- 
Ron Reidy
Oracle DBA



------------------------------

Date: 15 Sep 2003 17:10:48 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: Newbie Question: Could someone show me how to implement options
Message-Id: <239ce42f.0309151610.4d160@posting.google.com>

Andreas Kahari <ak+usenet@freeshell.org> wrote in message news:<slrnbmc2tk.r0i.ak+usenet@vinland.freeshell.org>...
> In article <150920032028070159%Borniac_1@hotmail.com>, Borniac wrote:

> 
> if (!getopts("hn:", \%opts) || (defined(%opts{h}) && $opts{h})) {
>     die "Usage: $0 -h | -n name\n";
> }


You know, this brings up a question that's bugged me a while.

Why should the idiom

(defined($hash{key}) && $hash{key}) 

be needed, really? Is it just to prevent a syntax error or undefined warning?

If so, I'd like a 

no use blah_warnings;

for it. Is there one?


------------------------------

Date: Tue, 16 Sep 2003 01:40:35 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Newbie Question: Could someone show me how to implement options
Message-Id: <3f6667e5.186964776@news.erols.com>

wherrera@lynxview.com (Bill) wrote:

: You know, this brings up a question that's bugged me a while.
: 
: Why should the idiom
: 
: (defined($hash{key}) && $hash{key}) 
: 
: be needed, really?

The defined() part isn't needed.  The only value of $hash{key} that
would return false in that part will also return false in the second
part.

I wouldn't call that an idiom at all.  The idiom would be to let
$hash{key} in boolean context return false on undef.

: Is it just to prevent a syntax error or undefined warning?

No warning is produced if $hash{key} is undefind and the defined() test
is eliminated.

: If so, I'd like a 
: 
: no use blah_warnings;
: 
: for it. Is there one?

Yes, there is.

    no warnings 'undefined';



------------------------------

Date: Tue, 16 Sep 2003 01:42:36 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Newbie Question: Could someone show me how to implement options
Message-Id: <3f666a68.187608060@news.erols.com>

tiltonj@erols.com (Jay Tilton) wrote:

: wherrera@lynxview.com (Bill) wrote:
:
: : If so, I'd like a 
: : 
: : no use blah_warnings;
: : 
: : for it. Is there one?
: 
: Yes, there is.
: 
:     no warnings 'undefined';

Check that.

    no warnings 'uninitialized';



------------------------------

Date: Mon, 15 Sep 2003 23:28:37 +0100
From: Garry Heaton <none@none.com>
Subject: Perl way to do PHP includes?
Message-Id: <b2r9b.6067$vX3.790831@wards.force9.net>

Are the following Perl/PHP methods roughly equivalent in function and
efficiencey?

1. use Perl_package;
   require_once(file.php);

2. open FILE, "< $perl_file";
   include(file.php);

I'm trying to determine whether Perl/CGI.pm (no Embperl, Mason etc.) is
sufficient for converting PHP scripts without incurring serious inefficiencies.

Regards

Garry Heaton




------------------------------

Date: Mon, 15 Sep 2003 16:33:43 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Perl way to do PHP includes?
Message-Id: <etoznh5vfzs.fsf@wormtongue.emschwar>

Garry Heaton <none@none.com> writes:
> Are the following Perl/PHP methods roughly equivalent in function and
> efficiencey?
>
> 1. use Perl_package;
>    require_once(file.php);

Vaguely.  You should read the perlmod docs ('perldoc perlmod') to find
out exactly how this works.  PHP just reads in the file and defines
all the functions in it in the global namespace; Perl lets you be more
fine-grained if you choose.

> 2. open FILE, "< $perl_file";
>    include(file.php);

Not even close.  Did you read the Perl docs for open() to see what it
does?

> I'm trying to determine whether Perl/CGI.pm (no Embperl, Mason etc.) is
> sufficient for converting PHP scripts without incurring serious inefficiencies.

The question to be sure you've answered is why convert them if they're
working now?  Assuming you have a good reason, then it's best to have
a good understanding of both languages.  perldoc perlbook for more
details about learning Perl.

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


------------------------------

Date: Tue, 16 Sep 2003 00:36:46 +0100
From: Garry Heaton <none@none.com>
Subject: Re: Perl way to do PHP includes?
Message-Id: <32s9b.6104$vX3.798725@wards.force9.net>


Eric Schwartz wrote:
> Garry Heaton <none@none.com> writes:
> 
>>Are the following Perl/PHP methods roughly equivalent in function and
>>efficiencey?
>>
>>1. use Perl_package;
>>   require_once(file.php);
> 
> 
> Vaguely.  You should read the perlmod docs ('perldoc perlmod') to find
> out exactly how this works.  PHP just reads in the file and defines
> all the functions in it in the global namespace; Perl lets you be more
> fine-grained if you choose.
> 
> 
>>2. open FILE, "< $perl_file";
>>   include(file.php);
> 
> 
> Not even close.  Did you read the Perl docs for open() to see what it
> does?
> 
> 
>>I'm trying to determine whether Perl/CGI.pm (no Embperl, Mason etc.) is
>>sufficient for converting PHP scripts without incurring serious inefficiencies.
> 
> 
> The question to be sure you've answered is why convert them if they're
> working now?  Assuming you have a good reason, then it's best to have
> a good understanding of both languages.  perldoc perlbook for more
> details about learning Perl.
> 
> -=Eric

Sorry, should have followed-up:

2. open FILE, "< $perl_file";
   while (<FILE>) {
      print;
   };

Garry



------------------------------

Date: Tue, 16 Sep 2003 00:38:40 +0100
From: Garry Heaton <none@none.com>
Subject: Re: Perl way to do PHP includes?
Message-Id: <R3s9b.6105$vX3.798804@wards.force9.net>

Garry Heaton wrote:
> Eric Schwartz wrote:
> 
>>Garry Heaton <none@none.com> writes:
>>
>>
>>>Are the following Perl/PHP methods roughly equivalent in function and
>>>efficiencey?
>>>
>>>1. use Perl_package;
>>>  require_once(file.php);
>>
>>
>>Vaguely.  You should read the perlmod docs ('perldoc perlmod') to find
>>out exactly how this works.  PHP just reads in the file and defines
>>all the functions in it in the global namespace; Perl lets you be more
>>fine-grained if you choose.
>>
>>
>>
>>>2. open FILE, "< $perl_file";
>>>  include(file.php);
>>
>>
>>Not even close.  Did you read the Perl docs for open() to see what it
>>does?
>>
>>
>>
>>>I'm trying to determine whether Perl/CGI.pm (no Embperl, Mason etc.) is
>>>sufficient for converting PHP scripts without incurring serious inefficiencies.
>>
>>
>>The question to be sure you've answered is why convert them if they're
>>working now?  Assuming you have a good reason, then it's best to have
>>a good understanding of both languages.  perldoc perlbook for more
>>details about learning Perl.
>>
>>-=Eric
> 
> 
> Sorry, should have followed-up:
> 
> 2. open FILE, "< $perl_file";
>    while (<FILE>) {
>       print;
>    };
> 
> Garry
> 

Or maybe even:

2. open FILE, "< $perl_file";
     while (<FILE>) {
        print;
     }

Garry




------------------------------

Date: Mon, 15 Sep 2003 23:32:20 GMT
From: Ismat Ebrahim <tulwycog@yrobc.org>
Subject: the shoes we wear
Message-Id: <670d985a.c7fa974a@utetmu.org>
























Rethink the Cool + the Shoe

phil knight had a dream.  he'd sell shoes.  he'd sell dreams.
he'd get rich.  he'd use sweatshops if he had to.

then along came a new shoe.  plain.  simple.  cheap.  fair.
designed for only one thing:  kicking phil's ass.

the unswoosher

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

For years, Nike was the undisputed champion of logo culture, 
its swoosh an instant symbol of global cool. 

Today, Phil Knight's Nike is a fading empire, badly hurt by 
years of "brand damage" as activists and culture jammers 
fought back against mindfuck marketing and dirty sweatshop labor.

Now a final challenge. We take on Phil at his own game - and win. 
We turn the shoes we wear into a counterbranding game. The swoosh 
versus the anti-swoosh. Which side are you on?

Adbusters has been doing R&D for more than a year, and guess what? 
Making a shoe - a good shoe - isn't exactly rocket science. 
With a network of supporters, we're getting ready to launch the 
blackSpot sneaker, the world's first grassroots anti-brand. 
You can help launch the blackSpot revolution.

THE BIG QUESTION:

        Is it possible to take Phil Knight's billion-dollar 
        marketing momentum and, in a quick judo-like move, slap 
        him onto the mat with the power of his own PR thrust?

OUR KICK-ASS MARKETING STRATEGY >> http://blackspotsneaker.org/02/

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$





$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

buy it............................preorders@blackspotsneaker.org

sell it...........................wholesale@blackspotsneaker.org

invest in it......................investors@blackspotsneaker.org

support it........................donations@blackspotsneaker.org

join the jam........................jammers@blackspotsneaker.org

        Make a straight donation... it's a worthy cause 
        with the potential to set an historic precedent 
        that could be repeated in other industries and 
        usher in more grass roots version of capitalism 
        in which megacorps do not control every area of 
        our children's lives.

https://www.groundspring.org/donate/index.cfm?ID=2217-0%7C742-0

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


















Ismat Ebrahim
Ronnie, still smelling, scolds almost mercilessly, as the lemon departs beside their kettle.





------------------------------

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



------------------------------

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.  

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 V10 Issue 5508
***************************************


home help back first fref pref prev next nref lref last post