[25419] in Perl-Users-Digest
Perl-Users Digest, Issue: 7664 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 17 21:05:22 2005
Date: Mon, 17 Jan 2005 18:05:10 -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 Mon, 17 Jan 2005 Volume: 10 Number: 7664
Today's topics:
Re: [perl-python] 20050117, filter, map <jurgenex@hotmail.com>
Re: A small question blaq.box@gmail.com
alternative to MS word doc (mike)
Re: alternative to MS word doc <1usa@llenroc.ude.invalid>
Re: creating socket on specific IP address (Michael Fuhr)
Error compiling DBD::Pg 1.32 <gj@freeshell.org>
Re: Kwik Q <1usa@llenroc.ude.invalid>
Re: looking for constructive criticism on this script.. <tadmc@augustmail.com>
Re: Low level data manipulation in Perl (Anno Siegel)
Re: MAP Question <peroli@gmail.com>
Re: MAP Question <1usa@llenroc.ude.invalid>
Re: Need help with Perl and MySQL database data load <oscar@nowhere.com>
Re: Perl CGI script to emulate a shell command line win <1usa@llenroc.ude.invalid>
Re: Perl CGI script to emulate a shell command line win <nospam@bigpond.com>
Re: Perl CGI script to emulate a shell command line win <2005+newstest@foobox.com>
Re: Perl CGI script to emulate a shell command line win <1usa@llenroc.ude.invalid>
Re: Perl CGI script to emulate a shell command line win ioneabu@yahoo.com
Re: Print question <jurgenex@hotmail.com>
Re: Script Not Returning Value <hx_101@hotmail.com>
Re: Script Not Returning Value <tadmc@augustmail.com>
Re: Taint problem with ActiveState <1usa@llenroc.ude.invalid>
Re: Taint problem with ActiveState <peroli@gmail.com>
Re: Where do you report perl bugs? <groleau+news@freeshell.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Jan 2005 00:48:44 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: [perl-python] 20050117, filter, map
Message-Id: <M1ZGd.6451$IP6.5418@trnddc05>
Abigail wrote:
> Steven Bethard (steven.bethard@gmail.com) wrote on MMMMCLVII September
> $$ Is there any chance you could post these all as part of the same
> thread?
>
> Just killfile him, and stop replying. Remember, don't feed the trolls.
True, except that he spreads lies about Perl and really bad code all over
the place.
If you don't tell people about how awful his skills are then they may
actually mistake his incompetency for flaws in Perl.
jue
------------------------------
Date: 17 Jan 2005 18:02:11 -0800
From: blaq.box@gmail.com
Subject: Re: A small question
Message-Id: <1106013598.352955.259950@f14g2000cwb.googlegroups.com>
thanks to you all people for correcting & clearifying me.
blaq
------------------------------
Date: 17 Jan 2005 17:15:56 -0800
From: s99999999s2003@yahoo.com (mike)
Subject: alternative to MS word doc
Message-Id: <dfd17ef4.0501171715.d5281e@posting.google.com>
hi
i wish to create a doc using perl and i am using the Win32:OLE module
to do that. The thing is , i will need to have the MSword application
installed. Is there
any oher modules/ways i can create a text file from scratch and also
has the ability to include some gifs/jpeg images?
thanks.
------------------------------
Date: 18 Jan 2005 01:42:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: alternative to MS word doc
Message-Id: <Xns95E1D2BFD5E83asu1cornelledu@132.236.56.8>
s99999999s2003@yahoo.com (mike) wrote in
news:dfd17ef4.0501171715.d5281e@posting.google.com:
> i wish to create a doc using perl and i am using the Win32:OLE module
> to do that. The thing is , i will need to have the MSword application
> installed. Is there any oher modules/ways i can create a text file from
> scratch and also has the ability to include some gifs/jpeg images?
Text files do not contain images.
What is your Perl question?
Sinan.
------------------------------
Date: 17 Jan 2005 19:00:10 -0700
From: mfuhr@fuhr.org (Michael Fuhr)
Subject: Re: creating socket on specific IP address
Message-Id: <41ec6daa$1_2@omega.dimensional.com>
"Al the Pal" <alex_the_hart@yahoo.com> writes:
> Thanks for the reply, but I wan't clear when I asked the question.
You said, "when I make a socket, I want control over which IP address
I connect from." Is that not what you meant?
> Although this is located on a server, I am asking about a client
> connection. The server has several IP addresses, but when I make an
> outgoing connection, I want to choose the IP that I make the connection
> on.
Do you want to control which IP address you connect from? That is,
the IP address that the client side of the connection will use?
That's what your original question sounded like, and the followup
from Chris Davies points to the solution. If meant something else
then please clarify.
> I see nothing in the socket command that let's me choose which IP
> the socket connects to locally.
The socket() function doesn't do that, another function does. Read
the manual pages Chris mentioned and understand how a server chooses
its IP address and port, then use the same mechanism for the client.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
------------------------------
Date: Tue, 18 Jan 2005 01:55:22 +0000 (UTC)
From: Gerald Jones <gj@freeshell.org>
Subject: Error compiling DBD::Pg 1.32
Message-Id: <cshqaa$1ak$1@chessie.cirr.com>
Hi all
I have the following error running make when compiling DBD::Pg 1.32, with
PostgreSQL 7.3.4, gcc 3.2.2, and Linux kernel 2.4.20-31.9 . (Incindentally,
the README references a pg_config which I can't find on my system. Is the
README outdated, or do I have an incomplete PostgreSQL installation? ) If any
one has an insight into how I can get DBD::Pg running, I would be grateful.
[snip]
gcc -c -I/usr/include -I/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/ -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DHAVE_PQescapeString -DHAVE_PQescapeBytea -DHAVE_PQunescapeBytea -O2 -g -pipe -march=i386 -mcpu=i686 -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc -DVERSION=\"1.32\" -DXS_VERSION=\"1.32\" -fPIC "-I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE" Pg.c
In file included from Pg.xs:13:
Pg.h:17:22: libpq-fe.h: No such file or directory
In file included from Pg.h:41,
from Pg.xs:13:
dbdimp.h:24: parse error before "PGconn"
dbdimp.h:24: warning: no semicolon at end of struct or union
dbdimp.h:38: parse error before '}' token
dbdimp.h:60: parse error before "PGresult"
dbdimp.h:60: warning: no semicolon at end of struct or union
dbdimp.h:73: parse error before '}' token
In file included from Pg.c:67:
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h: In function `dbdxst_bind_params':
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:51: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:52: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:56: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:57: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:58: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h: In function `dbdxst_fetchall_arrayref':
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:83: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:84: dereferencing pointer to incomplete type
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBI/Driver_xst.h:91: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_selectall_arrayref':
Pg.xsi:135: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_selectrow_arrayref':
Pg.xsi:170: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_commit':
Pg.xsi:249: dereferencing pointer to incomplete type
Pg.xsi:249: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_rollback':
Pg.xsi:259: dereferencing pointer to incomplete type
Pg.xsi:259: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_disconnect':
Pg.xsi:269: dereferencing pointer to incomplete type
Pg.xsi:273: dereferencing pointer to incomplete type
Pg.xsi:274: dereferencing pointer to incomplete type
Pg.xsi:275: dereferencing pointer to incomplete type
Pg.xsi:279: dereferencing pointer to incomplete type
Pg.xsi:279: dereferencing pointer to incomplete type
Pg.xsi:281: dereferencing pointer to incomplete type
Pg.xsi:283: dereferencing pointer to incomplete type
Pg.xsi:287: dereferencing pointer to incomplete type
Pg.xsi:287: dereferencing pointer to incomplete type
Pg.xsi:287: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_STORE':
Pg.xsi:301: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_FETCH':
Pg.xsi:313: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__db_DESTROY':
Pg.xsi:323: dereferencing pointer to incomplete type
Pg.xsi:325: dereferencing pointer to incomplete type
Pg.xsi:325: dereferencing pointer to incomplete type
Pg.xsi:326: dereferencing pointer to incomplete type
Pg.xsi:332: dereferencing pointer to incomplete type
Pg.xsi:333: dereferencing pointer to incomplete type
Pg.xsi:334: dereferencing pointer to incomplete type
Pg.xsi:336: dereferencing pointer to incomplete type
Pg.xsi:337: dereferencing pointer to incomplete type
Pg.xsi:337: dereferencing pointer to incomplete type
Pg.xsi:337: dereferencing pointer to incomplete type
A
Pg.xsi:339: dereferencing pointer to incomplete type
Pg.xsi:347: dereferencing pointer to incomplete type
Pg.xsi:348: dereferencing pointer to incomplete type
Pg.xsi:349: dereferencing pointer to incomplete type
Pg.xsi:350: dereferencing pointer to incomplete type
Pg.xsi:356: dereferencing pointer to incomplete type
Pg.xsi:356: dereferencing pointer to incomplete type
Pg.xsi:356: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__st_execute':
Pg.xsi:546: dereferencing pointer to incomplete type
Pg.xsi:547: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__st_finish':
Pg.xsi:627: dereferencing pointer to incomplete type
Pg.xsi:628: dereferencing pointer to incomplete type
Pg.xsi:632: dereferencing pointer to incomplete type
Pg.xsi:635: dereferencing pointer to incomplete type
Pg.xsi:635: dereferencing pointer to incomplete type
Pg.xsi:635: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__st_STORE':
Pg.xsi:675: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__st_FETCH_attrib':
Pg.xsi:692: dereferencing pointer to incomplete type
Pg.xsi: In function `XS_DBD__Pg__st_DESTROY':
Pg.xsi:702: dereferencing pointer to incomplete type
Pg.xsi:704: dereferencing pointer to incomplete type
Pg.xsi:704: dereferencing pointer to incomplete type
Pg.xsi:705: dereferencing pointer to incomplete type
Pg.xsi:710: dereferencing pointer to incomplete type
Pg.xsi:711: dereferencing pointer to incomplete type
Pg.xsi:711: dereferencing pointer to incomplete type
Pg.xsi:711: dereferencing pointer to incomplete type
Pg.xsi:713: dereferencing pointer to incomplete type
Pg.xsi:714: dereferencing pointer to incomplete type
Pg.xsi:715: dereferencing pointer to incomplete type
Pg.xsi:723: dereferencing pointer to incomplete type
Pg.xsi:723: dereferencing pointer to incomplete type
Pg.xsi:723: dereferencing pointer to incomplete type
Pg.xsi: In function `boot_DBD__Pg':
Pg.xsi:22: sizeof applied to an incomplete type
Pg.xsi:23: sizeof applied to an incomplete type
make: *** [Pg.o] Error 1
B
[snip]
------------------------------
Date: 17 Jan 2005 23:37:43 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Kwik Q
Message-Id: <Xns95E1BD853D32Easu1cornelledu@132.236.56.8>
ipellew@pipemedia.co.uk wrote in news:1106001510.323657.14660
@z14g2000cwz.googlegroups.com:
> Subject: Kwik Q
What on earth is that?
> Whats the Perl var that holds the directory file seperator, IE "/" or
> "\"
I think you want to use File::Spec if you are trying to form file paths in
a platform independent manner.
> Is there one that holds the dot character? Usually "."
> as in perl.exe
'.'
Sinan.
------------------------------
Date: Mon, 17 Jan 2005 19:26:06 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: looking for constructive criticism on this script....
Message-Id: <slrncuopde.2cr.tadmc@magna.augustmail.com>
John Smith <jsmith@macroshaft.com> wrote:
> #!/usr/bin/perl -w
The modern (and more complete) way is:
#!/usr/bin/perl
use warnings;
use strict;
You should ask for all the help you can get.
> if ($cdrom eq "\n")
> {
> $cdrom = '/dev/acd0';
> }
> else
> {
> chomp($cdrom);
> }
chomp $cdrom;
$cdrom = '/dev/acd0' unless length $cdrom;
> $config{CD_DEVICE}="$cdrom";
perldoc -q vars
What's wrong with always quoting "$vars"?
so that should be:
$config{CD_DEVICE} = $cdrom;
(whitespace is not a scarce resource, feel free to use as much as
you want to help make your code easier to read. Have you seen
perlstyle.pod yet?
)
> my $whereArtist = index($cd{artist}, "&");
> if ($whereArtist ne -1)
You should use the string comparison operators on strings, and
the numeric comparison operators on numbers, so that should be either
if ($whereArtist != -1)
or
if ($whereArtist ne '-1')
> {
> substr($cd{artist}, $whereArtist, 1) = "and";
> }
But you can replace all of that code with just this:
$cd{artist} =~ s/&/and/;
> print "Artist: $cd{artist}\n";
> print "Title: $cd{title}\n";
> print "Category: $cd{cat}\n";
> print "CDDD-ID: $cd{id}\n";
> print "Tracks: $cd{tno}\n\n";
Consider using a "here-doc" in place of a bazillion print statements.
> print "\nShall I create \"$path\/$cd{artist}\/$cd{title}\" for you, y or n?\n";
Slashes are not special in a string, there is no need to backslash them.
If you use an alternate form of quoting you can avoid backslashing
the double quotes too:
print qq(\nShall I create "$path/$cd{artist}/$cd{title}" for you, y or n?\n);
> system "mkdir -p \"$path\"";
No need to shell out to do that, use Perl's own builtin function:
perldoc -f mkdir
> if ($i == 1)
Here you _do_ use the right type of comparison...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Jan 2005 23:47:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Low level data manipulation in Perl
Message-Id: <cshiqt$cn3$1@mamenchi.zrz.TU-Berlin.DE>
Leonard Challis <perl@lennychallis.co.uk> wrote in comp.lang.perl.misc:
> Awesome.
Looks like you finally got it.
[snip TOFU]
Anno
------------------------------
Date: 17 Jan 2005 17:31:19 -0800
From: "Peroli" <peroli@gmail.com>
Subject: Re: MAP Question
Message-Id: <1106011879.674678.237640@z14g2000cwz.googlegroups.com>
hi george,
If Map bugs you, why dont you try grep. It works.
Peroli Sivaprakasam
------------------------------
Date: 18 Jan 2005 01:45:00 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: MAP Question
Message-Id: <Xns95E1D319C888Basu1cornelledu@132.236.56.8>
"Peroli" <peroli@gmail.com> wrote in news:1106011879.674678.237640
@z14g2000cwz.googlegroups.com:
> hi george,
> If Map bugs you, why dont you try grep. It works.
map (not Map) works too. map and grep do different things. See
perldoc -f map
perldoc -f grep
Sinan.
------------------------------
Date: Tue, 18 Jan 2005 00:50:56 GMT
From: Oscar <oscar@nowhere.com>
Subject: Re: Need help with Perl and MySQL database data load
Message-Id: <Q3ZGd.26098$Ta2.26009@fe2.texas.rr.com>
Tore Aursand wrote:
> Oscar wrote:
>
>> I'm not sure what top-post refers to. Hope I'm not doing it now.
>
>
> You are. Top-posting means that you are posting your answer in front of
> the part you are answering. That's a bad habit; it's like answering
> someone before you've even heard the question.
>
>> #!/perl/bin/perl -w
>> #insert data into mysql
>> use strict;
>> use DBI;
>
>
> If you're running a newer version of Perl, you should change this to:
>
> #!/usr/bin/perl
> #
> use strict;
> use warnings;
>
>> package MySQL;
>
>
> Don't do that. You are telling Perl that you're creating a package named
> 'MySQL' with this line. You aren't doing that, are you?
>
>> my $dsn = 'DBI:mysql:database=sd_tst;host=localhost;port=3306';
>> my $user = 'root';
>> my $pass = 'xxxxxxx';
>> my %args = ( RaiseError => 1,
>> AutoCommit => 1 );
>>
>> my $dbh = DBI->connect( $dns, $user, $pass, \%args )
>> or die "Can't connect; $DBI:errstr";
>>
>> $dbh->do("LOAD DATA LOCAL INFILE '/sd_data/audit_20041208.txt' INTO TABLE
>> sd_tst FIELDS TERMINATED BY '\|' LINES TERMINATED BY '\r\n';");
>>
>> $dbh->disconnect ();
>
>
> What error message(s) do you get? I haven't imported files this way in a
> long time, so I'm not sure if the syntax is right, but I'm sure you've
> read the documentation?
>
>
Hello,
When I remove the line
use DBI; I get the error message "Can't locate object method "connect"
via packge "DBI" (perhaps you forgot to load "DBI"?) at sqltst2.pl line 12."
When I put that line, use DBI;, back in I then get an authentication
procotol error message:
"DBI connect
('database=sds_tst;host=localhost;port=3306,'root',....)failed: Client
does not support authentication protocol requested by server;consider
upgrading MYSQL client at sqltst2.pl line 13."
I have the latest MySQL client installed.
I have reviewed the DBI documentation however just about all of the
examples contained refer to Perl on a UNIX box connecting to an Oracle
database. I use the path /perl/bin/perl as this is where my executables
are located. I don't have the usual USR directory since I am not using
UNIX/Linux.
My PC is WindowsXP connecting to MySQL (4.1). Here is the latest
version of the Perl script:
Thanks,
Oscar
#!/perl/bin/perl -w
#insert data into mysql
use strict;
use warnings;
use DBI;
my $dsn = 'DBI:mysql:database=sd_tst;host=localhost;port=3306';
my $user = 'root';
my $pass = 'xxxxxxx';
my %args = ( RaiseError => 1,
AutoCommit => 1 );
my $dbh = DBI->connect( $dsn, $user, $pass, \%args )
or die "Can't connect:". dbi->errstr;
$dbh->do("LOAD DATA LOCAL INFILE '/sd_data/audit_20041208.txt' INTO TABLE
sd_tst FIELDS TERMINATED BY '\|' LINES TERMINATED BY '\r\n';");
$dbh->disconnect ();
#EOF
------------------------------
Date: 17 Jan 2005 23:47:20 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <Xns95E1BF264EBDDasu1cornelledu@132.236.56.8>
"Alain Star" <2005+newstest@foobox.com> wrote in
news:41ec3637$0$22465$626a14ce@news.free.fr:
> You have a Windows machine with a Perl interpreter (ActivePerl from
> ActiveState for example).
> You have FTP access to a Linux box with a Perl CGI script engine
> (typically, the box where your website is hosted)
> But you are very frustrated because you do not have a TELNET or a SSH
> access to this box, it would be much more easy to zip or untar your
> files... The solution we suggest you is to create two scripts, a CGI
> wich will run on the server and a Perl script that will run locally in
> a command line window. The local software will send commands to your
> CGI in an HTTP request, the CGI will interpret the command and will
> return the output wich will be displayed by the windows script.
It occurs to me that there a lot of nutty people out there. You seem to be
one of them by suggesting people install a Trojan horse accessible to
anyone in the world on their hosting provider's machine.
Not nice.
perldoc perlsec
Sinan.
------------------------------
Date: Tue, 18 Jan 2005 09:59:24 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <3531qtF4ip2eaU1@individual.net>
Alain Star wrote:
> You have a Windows machine with a Perl interpreter (ActivePerl from
> ActiveState for example).
> You have FTP access to a Linux box with a Perl CGI script engine
> (typically, the box where your website is hosted)
> But you are very frustrated because you do not have a TELNET or a SSH
> access to this box, it would be much more easy to zip or untar your
> files... The solution we suggest you is to create two scripts, a CGI wich
> will run on the server and a Perl script that will run locally in a
> command line window. The local software will send commands to your CGI in
> an HTTP request, the CGI will interpret the command and will return the
> output wich will be displayed by the windows script.
>
> Script: http://www.cri.ch/perl/docs/cg0001.html
>
> Comments welcome!
>
> Regards,
>
> AS.
The solution is to ditch windows, install unix/ssh.
gtoomey
------------------------------
Date: Tue, 18 Jan 2005 01:14:09 +0100
From: "Alain Star" <2005+newstest@foobox.com>
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <41ec54d1$0$22466$626a14ce@news.free.fr>
A. Sinan Unur wrote:
:::: Script: http://www.cri.ch/perl/docs/cg0001.html
:: It occurs to me that there a lot of nutty people out there. You seem
:: to be one of them by suggesting people install a Trojan horse
:: accessible to anyone in the world on their hosting provider's
:: machine.
::
:: Not nice.
::
:: perldoc perlsec
What a negative approach...
The idea is to help, not to harm.
AS
------------------------------
Date: 18 Jan 2005 00:20:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <Xns95E1C4CC4D4B3asu1cornelledu@132.236.56.8>
"Alain Star" <2005+newstest@foobox.com> wrote in news:41ec54d1$0$22466
$626a14ce@news.free.fr:
> A. Sinan Unur wrote:
>
>
>:::: Script: http://www.cri.ch/perl/docs/cg0001.html
>
>:: It occurs to me that there a lot of nutty people out there. You seem
>:: to be one of them by suggesting people install a Trojan horse
>:: accessible to anyone in the world on their hosting provider's
>:: machine.
>::
>:: Not nice.
>::
>:: perldoc perlsec
>
> What a negative approach...
> The idea is to help, not to harm.
This makes me think of roads to hell and bridges in Brooklyn.
For the benefit of others, just say no to this idea. It is a giant
security whole begging to be exploited by any script kiddie out there.
Sinan.
------------------------------
Date: 17 Jan 2005 16:32:21 -0800
From: ioneabu@yahoo.com
Subject: Re: Perl CGI script to emulate a shell command line window
Message-Id: <1106008341.451564.98840@c13g2000cwb.googlegroups.com>
[...]
> Script: http://www.cri.ch/perl/docs/cg0001.html
>
> Comments welcome!
>
> Regards,
>
> AS.
I use something similar to access information from my Linux based
account from any web browser.
The weakness of your approach is to require any client software.
There is a pretty good Java based ssh program out there that is another
option. I think it is called Mindterm.
wana
------------------------------
Date: Tue, 18 Jan 2005 01:03:04 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Print question
Message-Id: <cfZGd.6452$IP6.2472@trnddc05>
Michele Dondi wrote:
> On Mon, 17 Jan 2005 10:39:00 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
> wrote:
>
>>> If you have a different understanding of CGI type language then I
>>> would be eager to hear it.
>>>
>>
>> It has been my experience that if you want to have an Internet server
>> computer run a (CGI) program for you at a Web site you need to
>> prepare your code using one of the languages that they will accept.
>> Different servers have different lists of languages which they allow
>> to be used. If I
>
> Please note that you're answering a comment that was not directed at
> something _you_ wrote.
Well, Mr. Anonymous has been in my killfile since his first outburst of
intelligence maybe a year ago. So I don't see any of his nonsense unless
someone else quotes it. In so far my comment (to which someone snipped the
attribution) was kind of directed at him, in particular as he used the term
"CGI type language" first.
Of course "using one of the languages they will accept" shows his utter lack
of even basic knowledge. How would an ISP even know if a CGI program was
written in Fortran, Pascal, C, or Cobol? A binary is a binary (well, ok, the
compiler probably left some markers somewhere, but who cares?).
>> understand this correctly, the Perl "Scripting Language" is almost
>> universally accepted. And it is to some extent different than the
>> Perl PC language which is discussed in this Newsgroup.
Now I would very much like to know what a Perl PC language is.
Mr. Anonymous, no, this is a rethorical question, no need to reply.
jue
------------------------------
Date: Mon, 17 Jan 2005 18:20:25 -0500
From: Digger <hx_101@hotmail.com>
Subject: Re: Script Not Returning Value
Message-Id: <91iou01s047s10rq42tr0m61hriq65hb1q@4ax.com>
On Mon, 17 Jan 2005 06:53:28 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:
>Digger wrote:
>> On Sat, 15 Jan 2005 18:58:47 GMT, "Jürgen Exner"
>> <jurgenex@hotmail.com> wrote:
>>
>>> Digger wrote:
>>>
>>> For a script to return a custom return value you have to use the
>>> exit() function.
>>> I don't see you using it anywhwere in your code.
>[First code snipped]
>>
>> Here's what I have so far....
>
>[updated code snipped]
>
>Ok, very slowly again:
>You want your script to return a value.
>To define the return value of a script and to terminate it at the same time
>you use the exit() function in Perl.
>Your updated program still does not call the exit() function anywhere.
>Therefore it does not return a value (well, depending on you OS it may
>return some default value for success or failure).
>
>jue
>
So how and where do I put it???
------------------------------
Date: Mon, 17 Jan 2005 19:09:28 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Script Not Returning Value
Message-Id: <slrncuooe8.2cr.tadmc@magna.augustmail.com>
Digger <hx_101@hotmail.com> wrote:
> open (SNMPLOG, ">snmp.log");
You should always, yes *always*, check the return value from open():
open (SNMPLOG, ">snmp.log") or die "could not open 'snmp.log' $!";
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 17 Jan 2005 23:35:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Taint problem with ActiveState
Message-Id: <Xns95E1BD39BAE92asu1cornelledu@132.236.56.8>
"bxb7668" <brian.bygland@boeing.com> wrote in
news:1105999155.487938.156830@f14g2000cwb.googlegroups.com:
> (Sorry for not including the context of previous posts. I don't know
> how to make Google do that)
> I could download and install Perl 5.8.6 if 1) I had administrator
> privilege and 2) I wanted to be fired. It is a terminatable offence to
> download without permission from the wild web. Besides which my scripts
> will be deployed to lots of PCs that would also need the upgrade. I
> don't control that.
You are not listening.
I suggested that you download the new version of Cwd and install it in a
private module directory for you script.
I said nothing about mucking around with the system-wide Perl
installation.
perldoc -q lib
Sinan.
------------------------------
Date: 17 Jan 2005 17:17:22 -0800
From: "Peroli" <peroli@gmail.com>
Subject: Re: Taint problem with ActiveState
Message-Id: <1106011042.796050.139650@f14g2000cwb.googlegroups.com>
hi brian,
with reference to your script :
####################################
#!/usr/bin/perl -w
use strict;
# Untainting stuff:
#
# 1) Untaint PATH
$ENV{PATH} = "";
# 2) Remove the IFS, CDPATH, ENV and BASH_ENV environment variables
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
# Add the VOBTools library location to @INC
use FindBin qw($Bin); # This is line 14
use lib ("${Bin}/perllib","${Bin}/../perllib");
print "$^O \n";
exit 0;
#####################################
line 14: use FindBin qw($Bin);
$Bin needs to be untainted, like this
$Bin =~ /(.*)/; # give your specific pattern
$Bin = $1;
It will be ok then.
Peroli Sivaprakasam
------------------------------
Date: Mon, 17 Jan 2005 18:21:17 -0500
From: Wes Groleau <groleau+news@freeshell.org>
Subject: Re: Where do you report perl bugs?
Message-Id: <lqOdnXso3sdv0XHcRVn-1Q@gbronline.com>
A. Sinan Unur wrote:
> [ Incomplete symptom description snipped ]
Unless you are the one trying to fix it, more details
than you want were in another thread.
> Use perlbug to report perl bugs (shocking, I know).
Thanks. Appeared to work (no error message).
Is there an auto-reply to show that it actually arrived?
--
Wes Groleau
------
"The reason most women would rather have beauty than brains is
they know that most men can see better than they can think."
-- James Dobson
------------------------------
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 V10 Issue 7664
***************************************