[19535] in Perl-Users-Digest
Perl-Users Digest, Issue: 1730 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 11 09:05:48 2001
Date: Tue, 11 Sep 2001 06:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1000213510-v10-i1730@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 11 Sep 2001 Volume: 10 Number: 1730
Today's topics:
Re: Baiting Gozilla to obtain quality code for nothing! <kathrynmwood@earthlink.com>
Re: Baiting Gozilla to obtain quality code for nothing! (Anno Siegel)
Re: Baiting Gozilla to obtain quality code for nothing! <matthew.garrish@sympatico.ca>
Re: Can't fork on certain computers? <goldbb2@earthlink.net>
cgi-page and exec (Rami Huhtala)
Convert hex dump to binary (Phil Hibbs)
Re: Convert hex dump to binary <philippe.perrin@sxb.bsf.alcatel.fr>
Re: Convert hex dump to binary <josef.moellers@fujitsu-siemens.com>
Emacs modules for Perl programming (Jari Aalto+mail.perl)
Re: File Upload CGI - Mac issue <s.warhurst@rl.ac.uk>
Re: File Upload CGI - Mac issue <s.warhurst@rl.ac.uk>
Re: File Upload CGI - Mac issue <bill.kemp@wire2.com>
Help: TiedHash.pm module in @INC not being recognized <mel2000@hotmaildot.com>
Re: Help: TiedHash.pm module in @INC not being recogniz <jgrg@sanger.ac.uk>
Re: how to get the length of string <tintin@snowy.calculus>
Re: mysql connection. <tintin@snowy.calculus>
Re: mysql connection. (Rafael Garcia-Suarez)
Re: non-blocking Socket IO problem? Help Req. <chris_h_morris@bigfoot.com>
ODBC with perl problem <mfrick@chariot.net.au>
OT: Fixing jeopardy quotes (was Re: how to get the leng <tintin@snowy.calculus>
Parsing problem (Please HELP ) (Laird)
Re: Parsing problem (Please HELP ) <tintin@snowy.calculus>
Re: Parsing problem (Please HELP ) <Thomas@Baetzler.de>
Re: Parsing problem (Please HELP ) (Laird)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 11 Sep 2001 11:59:02 GMT
From: "Kate" <kathrynmwood@earthlink.com>
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <a0nn7.17$lE3.2087@newsread2.prod.itd.earthlink.net>
> You say that as if her feminist phraseology wasn't just so much
balderdash,
> just like the occasional mention of Che Guevara and the "Rouge Programmer"
> attitude. Kira has discredited herself politically to a degree that
> nothing she says can be taken at face value.
See how easy y'all are to bait?
I think my point is made ...
Lighten up!
------------------------------
Date: 11 Sep 2001 12:21:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <9nkvka$587$1@mamenchi.zrz.TU-Berlin.DE>
According to Kate <kathrynmwood@earthlink.com>:
>
> > You say that as if her feminist phraseology wasn't just so much
> balderdash,
> > just like the occasional mention of Che Guevara and the "Rouge Programmer"
> > attitude. Kira has discredited herself politically to a degree that
> > nothing she says can be taken at face value.
>
>
> See how easy y'all are to bait?
> I think my point is made ...
> Lighten up!
This is way off topic, but the remark is making me curious. What bait?
And, for that matter, what point?
Anno
------------------------------
Date: Tue, 11 Sep 2001 08:45:30 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Baiting Gozilla to obtain quality code for nothing!!
Message-Id: <OEnn7.8822$Ye2.1340642@news20.bellglobal.com>
"Kate" <kathrynmwood@earthlink.com> wrote in message
news:a0nn7.17$lE3.2087@newsread2.prod.itd.earthlink.net...
>
>
> See how easy y'all are to bait?
> I think my point is made ...
> Lighten up!
>
>
Ahh, so the CLPM troll has a new name. Good for you Frank! Did you set a
time-bomb in my computer last year, because your posting is pure mule
manure? Take your plastic shovel and go elsewhere you Sissified Geek!
Mattzilla! King of Density
------------------------------
Date: Tue, 11 Sep 2001 03:40:21 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Can't fork on certain computers?
Message-Id: <3B9DBFE5.CB600263@earthlink.net>
Graham W. Boyes wrote:
> Graham W. Boyes wrote:
>
> > I want to capture the output of a program called mem.exe and use it
> > in my program. I have this code:
> >
> > open FORK, "MEM |" or die "Doesn't work";
> >
> > It works on most computers (I tried an NEC and two custom built
> > machines) but on certain IBM machines it gives the error "Doesn't
> > work! at a:\myfile.pl line 66, <STDIN> chunk 6."
>
> I figured it out. It was because the IBM machines had NTFS formatted
> drives and the fork apparently needs to use a hard drive to store a
> temporary file.
This indicates that the problem isn't the machinery... it's the
operating system. Perl doesn't care that it's an IBM -- it cares that
it's MSWindows.
On dos and windows, there is no actual fork function -- perl fakes it,
to make it *look* as if you're forking. If you try to do
open(FORK,"MEM|") on such operating systems, it will do something akin
to system("MEM>tempfile"), open(FORK,"<tempfile"). This usually works
ok, but sometimes the illusion has a few holes in it -- such as when
there's no place for a tempfile.
> When I tried it on machines with FAT32 formatted drives, it was fine.
> When I tried it on a machine without a hard drive at all, the problem
> occured.
>
> Back to square one I guess...a lot of machine I will run this program
> on don't have hard drives.
The solution is to try and run it as an actual, seperate, asynchronous
process, rather than the fake version which open(...|) uses.
use IPC::Open2;
open(DEVNULL, "<null");
my $pid = open2( FORK, "<&DEVNULL", "mem.exe" );
while( my $aline = <FORK> ) {
# do stuff with $aline.
}
close FORK;
if( waitpid $pid, 0 ) {
my ($sig, $ret) = ( $? & 255, $? >> 8 );
die "mem.exe died from signal $sig" if $sig;
die "mem.exe exited with code $ret" if $ret;
} else {
die "waitpid($pid) failed: $!";
}
NB: this code is untested, but *should* work, even on machines with no
disk drives. I think. Maybe.
PS, if it *does* work, post a message here saying so... I want to know!
PPS, I have no idea why the method which open2 uses isn't used by
open(...|) ... maybe it will be in the future?
--
"I think not," said Descartes, and promptly disappeared.
------------------------------
Date: 11 Sep 2001 05:17:47 -0700
From: ramirez134@hotmail.com (Rami Huhtala)
Subject: cgi-page and exec
Message-Id: <ac1562ed.0109110417.49d972c3@posting.google.com>
Hie
I have a this promlem:
I have perl cgi html-page and there is a button, when you push a button
its runs other perl program (this is only perl script not cgi). Okay its
runs the other program okay but browser goes give error message:
This server has encountered an internal error which prevents
it from fulfilling your request. The most likely cause is a misconfiguration.
where is the problem. cgi-script is like:
#!/usr/bin/perl
use CGI;
$query = CGI->new();
print $query->header();
$run = $query->param('run');
print "<!doctype html public ' -//w3c//dtd html 4.0 transitional//en'>\n";
print "<html>\n";
print "<head>\n";
print "<title>CSV FILES</title>\n";
print "</head>\n";
print "<body>\n";
print "<table>";
print "<form name=Form1action='http://server/cgi-bin/get_files.pl' METHOD='POST'>";
print '<tr><td><input name=run type=submit value="Run"></td>';
print "</form>";
if ($run ne '')
{
exec("/server/cgi-bin/csv.pl");
}
and csv.pl makes only file
Thanks
Rami
------------------------------
Date: 11 Sep 2001 00:31:53 -0700
From: phil.hibbs@capgemini.co.uk (Phil Hibbs)
Subject: Convert hex dump to binary
Message-Id: <153e25f0.0109102331.3c3e6ee5@posting.google.com>
Is there anything around that would help me take something like this:
0000: 0d 0a 0d 0a 41 70 70 6c ....Appl
0008: 69 63 61 74 69 6f 6e 20 ication.
0010: 65 78 63 65 70 74 69 6f exceptio
0018: 6e 20 6f 63 63 75 72 72 n.occurr
0020: 65 64 3a 0d 0a ed:
and convert it to a plain text file containing "Application exception
occurred:" etc.
Phil Hibbs.
------------------------------
Date: Tue, 11 Sep 2001 10:09:23 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: Convert hex dump to binary
Message-Id: <3B9DC6B3.D710C97A@sxb.bsf.alcatel.fr>
Phil Hibbs wrote:
> 0000: 0d 0a 0d 0a 41 70 70 6c ....Appl
> 0008: 69 63 61 74 69 6f 6e 20 ication.
> 0010: 65 78 63 65 70 74 69 6f exceptio
> 0018: 6e 20 6f 63 63 75 72 72 n.occurr
> 0020: 65 64 3a 0d 0a ed:
> and convert it to a plain text file containing "Application exception
> occurred:" etc.
# not tested
my $string = "";
while(<>) { # read from standard input
chomp;
my @words = split(/ +/);
$string .= $words[@words - 1];
}
$string =~ s/\.+/ /g;
print "$string\n";
# hope this helps
--
PhP
($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}
------------------------------
Date: Tue, 11 Sep 2001 11:27:44 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Convert hex dump to binary
Message-Id: <3B9DD910.D5DC345D@fujitsu-siemens.com>
Phil Hibbs wrote:
> =
> Is there anything around that would help me take something like this:
> =
> 0000: 0d 0a 0d 0a 41 70 70 6c ....Appl
> 0008: 69 63 61 74 69 6f 6e 20 ication.
> 0010: 65 78 63 65 70 74 69 6f exceptio
> 0018: 6e 20 6f 63 63 75 72 72 n.occurr
> 0020: 65 64 3a 0d 0a ed:
> =
> and convert it to a plain text file containing "Application exception
> occurred:" etc.
Have you tried
perldoc -f hex
I'd suggest split + hex to do the dirty work.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 11 Sep 2001 11:03:16 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1000206122@rtfm.mit.edu>
Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>
Announcement: "What Emacs lisp modules can help with programming Perl"
Preface
Emacs is your friend if you have to do anything comcerning software
development: It offers plug-in modules, written in Emacs lisp
(elisp) language, that makes all your programmings wishes come
true. Please introduce yourself to Emacs and your programming era
will get a new light.
Where to find Emacs/XEmacs
o Unix:
http://www.gnu.org/software/emacs/emacs.html
http://www.xemacs.org/
o Windows
http://www.gnu.org/software/emacs/windows/ntemacs.html
ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe
o More Emacs resources at
http://tiny-tools.sourceforge.net/emacs-elisp.html
Emacs Perl Modules
Cperl -- Perl programming mode
.ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
.<olson@mcs.anl.gov> Bob Olson (started 1991)
.<ilya@math.ohio-state.edu> Ilya Zakharevich
Major mode for editing perl files. Forget the default
`perl-mode' that comes with Emacs, this is much better. Comes
standard in newest Emacs.
TinyPerl -- Perl related utilities
.http://tiny-tools.sourceforge.net/
If you ever wonder how to deal with Perl POD pages or how to find
documentation from all perl manpages, this package is for you.
Couple of keystrokes and all the documentaion is in your hands.
o Instant function help: See documentation of `shift', `pop'...
o Show Perl manual pages in *pod* buffer
o Load source code into Emacs, like Devel::DProf.pm
o Grep through all Perl manpages (.pod)
o Follow POD manpage references to next pod page with TinyUrl
o Coloured pod pages with `font-lock'
o Separate `tiperl-pod-view-mode' for jumping topics and pages
forward and backward in *pod* buffer.
o TinyUrl is used to jump to URLs (other pod pages, man pages etc)
mentioned in POD pages. (It's a general URL minor mode)
TinyIgrep -- Perl Code browsing and easy grepping
[TinyIgrep is included in the Kit]
To grep from all installed Perl modules, define database to
TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
how to set up datatbases for Perl5, Perl4 whatever you have
installed
TinyIgrep calls Igrep.el to run the find for you, You can adjust
recursive grep options, ignored case, add user grep options.
You can get `igrep.el' module from <kevinr@ihs.com>. Ask for copy.
Check also ftp://ftp.ihs.com/pub/kevinr/
TinyCompile -- Browsing grep results in Emacs *compile* buffer
TinyCompile is minor mode for *compile* buffer from where
you can collapse unwanted lines, shorten the file URLs
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
/asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT
-->
cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
file1:NNN: MATCHED TEXT
file1:NNN: MATCHED TEXT
End
------------------------------
Date: Tue, 11 Sep 2001 10:38:07 +0100
From: "S Warhurst" <s.warhurst@rl.ac.uk>
Subject: Re: File Upload CGI - Mac issue
Message-Id: <9nkm21$qji@newton.cc.rl.ac.uk>
"W K" <bill.kemp@wire2.com> wrote in message
news:LJ1n7.609$t97.7438@news.uk.colt.net...
> > # Upload file
> > open (OUTFILE, ">$");
>
> I don't get this bit. ">$string_with_a_filename_in_it" perhaps.
> does "$" on its own mean something I don't know about?
Soz, that was me.. the $ should be the path/filename to write to on the
server.
> Anyway. You aren't checking whether the file has opened or not.
> Without error checking things will fail (if you are lucky), and you won't
> know why.
Well that was me, when I modified the code. In another part of the program I
already check to make sure there is no file already in the directory the
file is to be written to, so I didn't think I needed error checking in
there.
> maybe. some. You'd best read some stuff about it.
> Preferably not from the site you have already used because anyone that
lets
> you open a file without checking whether the file opened is leading you
down
> a dodgy garden path.
Thanks.. I shall have a surf on this. It's tricky, because our customers
wouldn't like it much if I got about renaming their files (they are
uploading files to a directory pertaining to a listserv list they have).
What I think I will do is just check for certain non-alphanumeric characters
and remove them from the filename instead.
Regards
------------------------------
Date: Tue, 11 Sep 2001 10:41:21 +0100
From: "S Warhurst" <s.warhurst@rl.ac.uk>
Subject: Re: File Upload CGI - Mac issue
Message-Id: <9nkm82$13fq@newton.cc.rl.ac.uk>
"Thomas Bätzler" <Thomas@Baetzler.de> wrote in message
news:4abppt8qodn3ash7pqkrth2sjcrpivg5h8@4ax.com...
> See the section "CREATING A FILE UPLOAD FIELD" in the CGI.pm
> documentation (perldoc CGI):
>
> -snip-
> To be safe, use the upload() function (new in version 2.47). When
> called with the name of an upload field, upload() returns a
> filehandle, or undef if the parameter is not a valid filehandle.
>
> $fh = $query->upload('uploaded_file');
> -snap-
>
> Additionally, you shouldn't reuse the incoming filename at all -
> depending on what server you're running on, people could do really
> weird things if they figure out that you just replace blanks with
> underscore characters. To be on the safe side, generate a unique file
> name from things like the current timestamp and your process id.
Thanks.. I will read up on CGI.pm. About filenames, I can't change them too
much because they are files relating to customer's listserv lists. However,
I can remove any dodgy non-alphanumeric characters, combined with replacing
spaces with underscores and that should get round any potentially dodgy
filenames.
Regards
------------------------------
Date: Tue, 11 Sep 2001 23:18:55 +0100
From: "W K" <bill.kemp@wire2.com>
Subject: Re: File Upload CGI - Mac issue
Message-Id: <Fyln7.623$t97.7613@news.uk.colt.net>
> > Anyway. You aren't checking whether the file has opened or not.
> > Without error checking things will fail (if you are lucky), and you
won't
> > know why.
>
> Well that was me, when I modified the code. In another part of the program
I
> already check to make sure there is no file already in the directory the
> file is to be written to, so I didn't think I needed error checking in
> there.
belt and braces.
Unless you never ever ever make mistakes you need error checking.
Then there's the question of write permissions, or other people making
mistakes.
Missing out error checking is not a good idea.
------------------------------
Date: Tue, 11 Sep 2001 03:27:11 -0700
From: "M.L." <mel2000@hotmaildot.com>
Subject: Help: TiedHash.pm module in @INC not being recognized
Message-Id: <9nkp1f$82b91$1@ID-19545.news.dfncis.de>
My program can't find the AnyData::Storage::TiedHash module no matter how I
point to it.
I tried pointing to it using the following methods according to PerlFAQ 8:
use lib '/u/s/sample/public_html/cgi-bin/lib/AnyData';
use lib '/u/s/sample/public_html/cgi-bin/lib/AnyData/Storage';
use AnyData;
and
use FindBin;
use lib "$FindBin::Bin/lib/AnyData";
use lib "$FindBin::Bin/lib/AnyData/Storage";
use AnyData;
And I get the same compilation errors whether I execute from Telnet or my
browser:
[Tue Sep 11 02:40:47 2001] AnyData.pm: [Tue Sep 11 02:40:47 2001]
AnyData.pm: [Tue Sep 11 02:40:47 2001] TiedHash.pm: Can't locate
AnyData/Storage/TiedHash.pm in @INC (@INC contains:
/userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/Storage
/userspace/u/s/sample/public_html/cgi-bin/lib/AnyData
/usr/lib/perl5/5.00503/sparc-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/sparc-linux /usr/lib/perl5/site_perl/5.005 .)
at /userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/AnyData.pm line 11.
[Tue Sep 11 02:40:47 2001] AnyData.pm: [Tue Sep 11 02:40:47 2001]
AnyData.pm: BEGIN failed--compilation aborted at
/userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/AnyData.pm line 11.
BEGIN failed--compilation aborted at buildpgs.cgi line 18.
The program bombs at the 'use AnyData::Storage::TiedHash' statement at line
11 of AnyData.pm. It looks as though the program ignores the
/u/s/sample/public_html/cgi-bin/lib/AnyData/Storage directory and instead is
trying to find TiedHash.pm in a no-prefixed directory called
AnyData/Storage.
Any help on getting the program to recognize where TiedHash.pm is located on
my system will be appreciated. Thanks.
------------------------------
Date: Tue, 11 Sep 2001 12:24:47 +0100
From: James Gilbert <jgrg@sanger.ac.uk>
To: "M.L." <mel2000@hotmaildot.com>
Subject: Re: Help: TiedHash.pm module in @INC not being recognized
Message-Id: <3B9DF47F.BF553F8B@sanger.ac.uk>
You need:
use lib '/u/s/sample/public_html/cgi-bin/lib';
You need to point to the root of the directory
tree; you're pointing to a branch.
James
"M.L." wrote:
>
> My program can't find the AnyData::Storage::TiedHash module no matter how I
> point to it.
>
> I tried pointing to it using the following methods according to PerlFAQ 8:
>
> use lib '/u/s/sample/public_html/cgi-bin/lib/AnyData';
> use lib '/u/s/sample/public_html/cgi-bin/lib/AnyData/Storage';
> use AnyData;
> and
> use FindBin;
> use lib "$FindBin::Bin/lib/AnyData";
> use lib "$FindBin::Bin/lib/AnyData/Storage";
> use AnyData;
>
> And I get the same compilation errors whether I execute from Telnet or my
> browser:
>
> [Tue Sep 11 02:40:47 2001] AnyData.pm: [Tue Sep 11 02:40:47 2001]
> AnyData.pm: [Tue Sep 11 02:40:47 2001] TiedHash.pm: Can't locate
> AnyData/Storage/TiedHash.pm in @INC (@INC contains:
> /userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/Storage
> /userspace/u/s/sample/public_html/cgi-bin/lib/AnyData
> /usr/lib/perl5/5.00503/sparc-linux /usr/lib/perl5/5.00503
> /usr/lib/perl5/site_perl/5.005/sparc-linux /usr/lib/perl5/site_perl/5.005 .)
> at /userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/AnyData.pm line 11.
> [Tue Sep 11 02:40:47 2001] AnyData.pm: [Tue Sep 11 02:40:47 2001]
> AnyData.pm: BEGIN failed--compilation aborted at
> /userspace/u/s/sample/public_html/cgi-bin/lib/AnyData/AnyData.pm line 11.
> BEGIN failed--compilation aborted at buildpgs.cgi line 18.
>
> The program bombs at the 'use AnyData::Storage::TiedHash' statement at line
> 11 of AnyData.pm. It looks as though the program ignores the
> /u/s/sample/public_html/cgi-bin/lib/AnyData/Storage directory and instead is
> trying to find TiedHash.pm in a no-prefixed directory called
> AnyData/Storage.
>
> Any help on getting the program to recognize where TiedHash.pm is located on
> my system will be appreciated. Thanks.
------------------------------
Date: Tue, 11 Sep 2001 21:10:33 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: how to get the length of string
Message-Id: <Njmn7.40$xP5.532505@news.interact.net.au>
"Denny Hardian" <delta1604@yahoo.com> wrote in message
news:CYan7.14713$Uf1.1292541@bgtnsc06-news.ops.worldnet.att.net...
> Dear Perl Gurus,
> I have a question on how to get the length of string in Perl. Is there any
> command in Perl to do that or I have to do some trick in order to solve
this
> ? Pls advise.
>
> For example :
>
> $a = "eat,run,sleep";
>
> I want to know the length of $a ( how many chars ). Should be 13 in this
> case. Any idea ?
length? length?.......Oh, it's a classic SAQ
------------------------------
Date: Tue, 11 Sep 2001 21:18:30 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: mysql connection.
Message-Id: <drmn7.42$%O5.517186@news.interact.net.au>
"Matthew Frick" <mfrick@chariot.net.au> wrote in message
news:3b9d669e$1_7@news.chariot.net.au...
> "Matthew Frick" <mfrick@chariot.net.au> wrote in message
> news:3b9d5072$1_6@news.chariot.net.au...
> > Can anyone give me a clue as to what I need to do to go about getting a
> > connection to a mysql db (on a lynix server) from an NT server?
Is lynix related to linux?
> ohh yeah and I am writing in perl which is why the post was in this
> newsgroup.
You'd be amazed at the amount of none Perl related stuff posted to this ng.
(including this one)
------------------------------
Date: 11 Sep 2001 12:33:39 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: mysql connection.
Message-Id: <slrn9ps15i.4vj.rgarciasuarez@rafael.kazibao.net>
Tintin wrote in comp.lang.perl.misc:
}
} Is lynix related to linux?
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?lynix
} You'd be amazed at the amount of none Perl related stuff posted to this ng.
} (including this one)
Ditto.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
$japh="Just another Perl hacker,\n";@j=split/(?= )/,$japh;for my $i
(0..3){*{(($x)=$j[3-$i]=~/\w+/g)[0]}=sub(@){print$j[$i]}}eval$japh;
------------------------------
Date: Tue, 11 Sep 2001 13:41:29 +0100
From: "Chris Morris" <chris_h_morris@bigfoot.com>
Subject: Re: non-blocking Socket IO problem? Help Req.
Message-Id: <9nl0pu$ihn$1@chilli.nntp.netline.net.uk>
My attempt to use sysread on a socket didn't work on Linux (although the
same script ran fine on Win98!)
I'd avoid this unles your host is very POSIX compliant.
------------------------------
Date: Tue, 11 Sep 2001 19:36:28 +0930
From: "Matthew Frick" <mfrick@chariot.net.au>
Subject: ODBC with perl problem
Message-Id: <3b9de148$1_1@news.chariot.net.au>
Does anyone know why with my connection to an oracle database the commented
out statement with the MAX included doesn't work yet without the MAX it does
work??
This one has me alittle stumped at this time of night. And I don't know if
it is my simple problem or a greater one.
thanks.
____________________________________________________________
# $statement1 = "SELECT MAX(P_L_DATE) FROM PROGRESS where U_ID = (select
u_id from users where u_number = '$uid')";
$statement1 = "SELECT P_L_DATE FROM PROGRESS where U_ID =(select u_id from
users where u_number = '$uid')";
print "Content-type text/html\n\n\n";
while ($odb->Sql($statement1)) {
print "SQL Failed. 1\n";
print "Error: " . $odb->Error() . "\n";
$odb->Close();
exit;
}
while ($odb->FetchRow()) {
%data = $odb->DataHash;
$lastlog = $data{'P_L_DATE'};
print "getting last logon : $lastlog <br>";
}
_________________________________________________________________________
--
___________________________________________________________
- l e a r n . e d s o l u t i o n s p t y l t d -
Matthew Frick Systems Administrator / Programmer
www.learnedsolutions.com mfrick@learnedsolutions.com
Level 1, 214 Greenhill Road, EASTWOOD, South Australia 5063
Phone: +61 8 8272 3111 (Ext. 643) Fax: +61 8 8272 3211
___________________________________________________________
E-mail Disclaimer:
http://www.learnedsolutions.com/disclaimer.html
___________________________________________________________
------------------------------
Date: Tue, 11 Sep 2001 21:16:44 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: OT: Fixing jeopardy quotes (was Re: how to get the length of string)
Message-Id: <zpmn7.41$rP5.530580@news.interact.net.au>
"Admin UsePad" <spam@funnybytes.com> wrote in message
news:9njid7$95$1@news.hccnet.nl...
> It worked!
>
> How do I get rid of this jeopardy quoted text? I'm using Outlook
See that mouse you're using? If you're right handed, it will be on the
right. If you are left handed it will be on the left. In Windoze, you have
an amazingly inovative feature known as "scroll bars". This incredible
feature allows you to scroll the text up or down. In your case, you can
scroll it down to insert your reply in the appropriate spot. Another
inovative Micro$oft feature was to include a cut/delete function. This
simple, but remarkably handy function allows you to remove parts of the text
(such as signatures) that aren't relevant to the reply.
When you've mastered these functions, you can obtain guru status by doing
everything *without* a mouse. Of course, this complicated and dangerous
operation should *not* be performed by beginners. It takes many, many years
of experience to ride in the fast lane.
Good luck ;-)
------------------------------
Date: 11 Sep 2001 00:33:30 -0700
From: kenlaird@yahoo.com (Laird)
Subject: Parsing problem (Please HELP )
Message-Id: <94a02505.0109102333.169c7b74@posting.google.com>
Hello everybody
I still have problem with parsing this file.
---------------
# name-a
service number1234 COMMENTS
# name-b
service numberxxxx COMMENTS
# name-c
service numberyyyy
# name-d name-e COMMENTS
service numberzzzz
service numbernnnn
# name-other COMMENTS
service number4321
---------------
In fact I would like this
...
# name-d name-e COMMENTS
service numberzzzz
service numbernnnn
to become this
...
# name-d COMMENTS
service numberzzzz
# name-e COMMENTS
service numbernnnn
Thanks in advance for any help
Cordially
Ken
------------------------------
Date: Tue, 11 Sep 2001 21:19:04 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: Parsing problem (Please HELP )
Message-Id: <Lrmn7.43$JR5.584740@news.interact.net.au>
"Laird" <kenlaird@yahoo.com> wrote in message
news:94a02505.0109102333.169c7b74@posting.google.com...
> Hello everybody
>
> I still have problem with parsing this file.
>
> ---------------
> # name-a
> service number1234 COMMENTS
>
> # name-b
> service numberxxxx COMMENTS
>
> # name-c
> service numberyyyy
>
> # name-d name-e COMMENTS
> service numberzzzz
> service numbernnnn
>
> # name-other COMMENTS
> service number4321
> ---------------
>
>
>
> In fact I would like this
>
>
> ...
> # name-d name-e COMMENTS
> service numberzzzz
> service numbernnnn
>
>
> to become this
> ...
>
> # name-d COMMENTS
> service numberzzzz
> # name-e COMMENTS
> service numbernnnn
What part of your code is causing problems?
------------------------------
Date: Tue, 11 Sep 2001 14:52:24 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Parsing problem (Please HELP )
Message-Id: <av1spts9in31sqdo9hg4c4n9u81q5jaoio@4ax.com>
On 11 Sep 2001 00:33:30 -0700, kenlaird@yahoo.com (Laird) wrote:
[same old same old]
Ken, it is not nice trying to get your problems fixed quicker by just
reposting the question. This is annoying. It is also not nice to post
the same meaningless junk as a reply to different posters. Here's some
code that may or may not do what you want.
#!/usr/bin/perl -w
use strict;
while( defined( my $line = <DATA> ) ){
chomp( $line );
# skip blank lines
next if $line =~ m/^\s*$/;
if( my( $start, $srvline ) = ( $line =~ m/^(#\s+)(.*)$/ ) ){
my $comments = "";
# chop off comments if present
if( $srvline =~ m/(.*?)(\s+[A-Z]+.*?)/ ){
$srvline = $1;
$comments = $2;
}
foreach my $service ( split /\s+/, $srvline ){
if( defined( $line = <DATA> ) && ($line =~ m/^service/) ){
print "$start$service$comments\n$line";
} else {
die "Expected a service... line but found '$line'\n";
}
}
}
}
__DATA__
# name-a
service number1234 COMMENTS
# name-b
service numberxxxx COMMENTS
# name-c
service numberyyyy
# name-d name-e COMMENTS
service numberzzzz
service numbernnnn
# name-other COMMENTS
service number4321
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";
------------------------------
Date: 11 Sep 2001 05:54:57 -0700
From: kenlaird@yahoo.com (Laird)
Subject: Re: Parsing problem (Please HELP )
Message-Id: <94a02505.0109110454.15a9f2b3@posting.google.com>
Hi everybody,
I changed the file in order to be more explicit.
This is what it looks like.
---
# name-1
service numberone COMMENTS
# name-2
service numbertwo COMMENTS
# name-3
service numberthree
# name-4 name-5 COMMENTS
service numberfour
service numberfive
# name-other COMMENTS
service numberother
---
I'm trying to put numberone after name-1
numbertwo after name-2
numberthree after name-3
numberfour after name-4
numberfive after name-5
numberother after name-other
The problem is in name-4 and name-5 because there are on the same line.
So this is my code but it doesn't work for name-4 and name-5.
#!/usr/bin/perl
open (IN,"data");
while (<IN>) {
$#a=0;
$serv="";
$i="";
push (@a,/\s(nam\S+)/g);
for $i(@a) {
($serv)=/(^serv\S+\s+\S+)/;
print "name = $i\n";
print "service = $serv\n";
}
}
Thanks in advance for any solution.
Cordially
Ken
------------------------------
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 1730
***************************************