[25154] in Perl-Users-Digest
Perl-Users Digest, Issue: 7403 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 14 11:05:56 2004
Date: Sun, 14 Nov 2004 08:05:08 -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 Sun, 14 Nov 2004 Volume: 10 Number: 7403
Today's topics:
404 not found message in simple script (Mortgageloan2004)
Re: 404 not found message in simple script <tintin@invalid.invalid>
Re: 404 not found message in simple script <gnari@simnet.is>
Re: CBC/BLOWFISH, NEWBIE HELP - CAN'T DECRYPT FROM SAVE (Homer J.)
Re: CBC/BLOWFISH, NEWBIE HELP - CAN'T DECRYPT FROM SAVE (Homer J.)
Re: creating and validating encrypted password <jwillmore@fastmail.us>
Cumulative distribution functions? (PJ)
Re: Cumulative distribution functions? <1usa@llenroc.ude.invalid>
Easiest way to read one character at a time until the f (Mortgageloan2004)
Re: Easiest way to read one character at a time until t <1usa@llenroc.ude.invalid>
Re: Extract domain name <Joe.Smith@inwap.com>
FAQ 3.1: How do I do (anything)? <comdog@panix.com>
Re: file attachment not working properly. <eighner@io.com>
Re: file attachment not working properly. <tadmc@augustmail.com>
Re: file attachment not working properly. <jwillmore@fastmail.us>
Re: Image::EXIF troubles <dd-b@dd-b.net>
More EXIF woes -- can Image::ExifTool return IPTC keywo <dd-b@dd-b.net>
Re: options to shrink-wrap a perl script (David Combs)
Re:backreferneces in search pattern <mstep@t-online.de>
Re: Script to pass info to GET string <Joe.Smith@inwap.com>
Re: Script to pass info to GET string <Joe.Smith@inwap.com>
Re: Script to pass info to GET string <usenet@morrow.me.uk>
Re: Using DBI for Remote myql connection <segraves_f13@mindspring.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Nov 2004 07:06:49 GMT
From: mortgageloan2004@aol.com (Mortgageloan2004)
Subject: 404 not found message in simple script
Message-Id: <20041114020649.06305.00000310@mb-m27.aol.com>
#!/usr/bin/perl
#Open up subdirectory, and read in contents one line at a time
open(FORM,'subdirectory.txt') || die "cannot open subdirectory for reading:
$!";
while (<FORM>) {
if (/form3/) {
print "the line is :" . $_;
close (FORM);
exit;
}
}
I get an error message every time saying 404 not found. The file is a simple
text file sitting in my cgi-bin. I'm searching for form3 in each line of the
file. Am I missing something here?
------------------------------
Date: Sun, 14 Nov 2004 21:36:14 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: 404 not found message in simple script
Message-Id: <2vojldF2o2g8rU1@uni-berlin.de>
"Mortgageloan2004" <mortgageloan2004@aol.com> wrote in message
news:20041114020649.06305.00000310@mb-m27.aol.com...
> #!/usr/bin/perl
> #Open up subdirectory, and read in contents one line at a time
> open(FORM,'subdirectory.txt') || die "cannot open subdirectory for
> reading:
> $!";
> while (<FORM>) {
> if (/form3/) {
> print "the line is :" . $_;
> close (FORM);
> exit;
> }
> }
>
> I get an error message every time saying 404 not found. The file is a
> simple
> text file sitting in my cgi-bin. I'm searching for form3 in each line of
> the
> file. Am I missing something here?
Change
#/usr/bin/perl
to
#!/usr/bin/sh
or
#!/usr/bin/doesn't/really/matter
The results should be hopefully enlightening for you.
------------------------------
Date: Sun, 14 Nov 2004 10:23:06 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: 404 not found message in simple script
Message-Id: <cn7bhr$e6a$1@news.simnet.is>
"Tintin" <tintin@invalid.invalid> wrote in message
news:2vojldF2o2g8rU1@uni-berlin.de...
>
> "Mortgageloan2004" <mortgageloan2004@aol.com> wrote in message
> news:20041114020649.06305.00000310@mb-m27.aol.com...
> > #!/usr/bin/perl
> > [snipped simple script that could have been even simpler]
> >
> > I get an error message every time saying 404 not found. The file is a
> > simple
> > text file sitting in my cgi-bin.
>
> Change
>
> #/usr/bin/perl
>
> to
>
> #!/usr/bin/sh
>
> or
>
> #!/usr/bin/doesn't/really/matter
>
> The results should be hopefully enlightening for you.
>
I have a feeling more explicit hints are needed in this case.
The 404 means that your script was not run at all, so it does
not matter what it supposedly does.
The problem may be one of:
your script is not executable
your script is not in the proper location
your webserver is not configured to run your script
my guess is the first one.
gnari
>
>
------------------------------
Date: 14 Nov 2004 06:59:12 -0800
From: homersimpson2@rogers.com (Homer J.)
Subject: Re: CBC/BLOWFISH, NEWBIE HELP - CAN'T DECRYPT FROM SAVED FILE
Message-Id: <5abd563.0411140659.7450fa56@posting.google.com>
Greg Schmidt <gregs@trawna.com> wrote in message news:<3g4d2q9c1ghp$.dlg@trawna.com>...
> On 10 Nov 2004 12:39:49 -0800, Homer J. wrote:
>
> > I'm stuck. I'm trying to use Crypt::CBC using Blowfish to encrypt
> > some data. I can get it to encrypt and decrypt OK as long as I assign
> > the ciphertext to a variable and decrpyt it from that variable all
> > within the same script execution. However, when I save the ciphertext
> > to a text file and then subsequently open the file and read in the
> > ciphertext to a variable and finally try to decrypt the cipheredtext I
> > get garbage instead of my original test message.
> >
> > Someone please help! I'm sure it's, something obviously wrong that
> > I've done, but I can't seem to figure out what it is.
>
> Are you writing and reading the file in binary mode? Text mode may do odd
> things to binary data such as cipertext.
Hi Thanks for your replies. Yes I think that did it! Thank you.
Homer
------------------------------
Date: 14 Nov 2004 07:00:23 -0800
From: homersimpson2@rogers.com (Homer J.)
Subject: Re: CBC/BLOWFISH, NEWBIE HELP - CAN'T DECRYPT FROM SAVED FILE
Message-Id: <5abd563.0411140700.5e98390@posting.google.com>
Bob Walton <see@sig.invalid> wrote in message news:<4192c665_3@127.0.0.1>...
> Homer J. wrote:
>
> ...
> > I'm stuck. I'm trying to use Crypt::CBC using Blowfish to encrypt
> > some data. I can get it to encrypt and decrypt OK as long as I assign
> > the ciphertext to a variable and decrpyt it from that variable all
> > within the same script execution. However, when I save the ciphertext
> > to a text file and then subsequently open the file and read in the
> > ciphertext to a variable and finally try to decrypt the cipheredtext I
> > get garbage instead of my original test message.
>
> perldoc -f binmode
>
> ...
> > Homer
> ...
Yes I think this did it. Binmode, seems to do the trick. Thanks all for your help.
Homer
------------------------------
Date: Sun, 14 Nov 2004 02:40:58 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: creating and validating encrypted password
Message-Id: <pan.2004.11.14.07.40.58.83605@fastmail.us>
On Sun, 14 Nov 2004 11:15:46 +0800, sam wrote:
> sam wrote:
>
>> Brian McCauley wrote:
>>
>>>
>>> If the password file is to use the standard Unix crypt() function then
>>> you would use the Perl builitin function that provides an interface to
>>> Unix crypt() function. (Guessing the name is left as an exercise for
>>> the reader).
>>>
>>>> Is there any example written in perl that I can follow?
>>>
>>>
>>>
>>> Yes, in the documentation of the aforementioned function.
>>>
>>>
>>
>> Thanks for the hints.
>> I found there is another perl module Digest::md5 for the same purpose.
>> What is this difference compare to Crypt::UnixCrypt_XS?
>>
> I found found Digest::MD5 is more usable. But the example only shows
> adding MD5 encrypted password to file, there is no method/function for
> reading and validate the password.
md5 creates a one way hash - it can't be decrypted per se. Instead, a
password is not validated as much as it's compared. When a user types a
password into the password field during a *nix login, the password
provided is encrypted and then compared to the value in the password file
(or shadow password file ... which is more commonly used today). If the
values match, the user is in. If they don't match, then the login failed.
Digest::MD5 is used more for checksums to see if a file has been altered
in any way, not for password fuctions. There are a whole host of Crypt
(http://search.cpan.org/search?query=crypt&mode=module) and Passwd
(http://search.cpan.org/search?query=passwd&mode=module) modules to choose
from that can help you do whatever it is you're trying to do, not to
mention the builtin Perl function 'crypt'
(http://www.perldoc.com/perl5.8.4/pod/func/crypt.html).
HTH
Jim
------------------------------
Date: 13 Nov 2004 21:49:01 -0800
From: perlmod@yahoo.com (PJ)
Subject: Cumulative distribution functions?
Message-Id: <6775b086.0411132149.53554100@posting.google.com>
I am going trough a book that uses that NORMDIST function in Excel. I
would like to repoduce the results in perl. Does anyone have a
function or module that is the same as Excel's NORMDIST? Actually, I
only need the cumulative distribution function (in Excel's NORMDIST
function, the 4th parameter is set to TRUE).
As an example, normdist(42, 40, 1.5, TRUE) equals 0.908789.
I am using perl on a FreeBSD machine - so I don't have access to Excel
via perl.
I appreciate any help,
-Garrett.
p.s. This is Excel's documentation of the function:
NORMDIST
Returns the normal distribution for the specified mean and standard
deviation. This function has a very wide range of applications in
statistics, including hypothesis testing.
Syntax
NORMDIST(x,mean,standard_dev,cumulative)
X is the value for which you want the distribution.
Mean is the arithmetic mean of the distribution.
Standard_dev is the standard deviation of the distribution.
Cumulative is a logical value that determines the form of the
function. If cumulative is TRUE, NORMDIST returns the cumulative
distribution function; if FALSE, it returns the probability mass
function.
------------------------------
Date: 14 Nov 2004 05:54:21 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Cumulative distribution functions?
Message-Id: <Xns95A1925FD08Fasu1cornelledu@132.236.56.8>
perlmod@yahoo.com (PJ) wrote in
news:6775b086.0411132149.53554100@posting.google.com:
> I am going trough a book that uses that NORMDIST function in Excel. I
> would like to repoduce the results in perl. Does anyone have a
> function or module that is the same as Excel's NORMDIST? Actually, I
> only need the cumulative distribution function (in Excel's NORMDIST
> function, the 4th parameter is set to TRUE).
CPAN is your friend:
http://search.cpan.org/~mikek/Statistics-Distributions-
1.02/Distributions.pm
------------------------------
Date: 14 Nov 2004 05:50:55 GMT
From: mortgageloan2004@aol.com (Mortgageloan2004)
Subject: Easiest way to read one character at a time until the first |
Message-Id: <20041114005055.07103.00000524@mb-m10.aol.com>
I'd like to grab a line from a file (up to the newline) and then read one
character of a lin starting at the far left, until I get to the end of the
first data element in a flat text file, (until first pipe symbol reached)
counting the number of characters with a counter. Assign the first counter -1
characters to a variable. Then test to see if it matches the string being
searched. If it does, then grab the third data element. Everything between the
2nd and 3rd pipe symbol and end the loop. If it doesn't match, then read in the
next line from the file.
Is this possible? Any ideas are appreciated very much.
Thanks,
Scot
------------------------------
Date: 14 Nov 2004 05:58:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Easiest way to read one character at a time until the first |
Message-Id: <Xns95A19CBAEA85asu1cornelledu@132.236.56.8>
mortgageloan2004@aol.com (Mortgageloan2004) wrote in
news:20041114005055.07103.00000524@mb-m10.aol.com:
> I'd like to grab a line from a file (up to the newline) and then read
> one character of a lin starting at the far left, until I get to the
> end of the first data element in a flat text file, (until first pipe
> symbol reached) counting the number of characters with a counter.
> Assign the first counter -1 characters to a variable. Then test to see
> if it matches the string being searched. If it does, then grab the
> third data element. Everything between the 2nd and 3rd pipe symbol and
> end the loop. If it doesn't match, then read in the next line from the
> file.
http://search.cpan.org/author/JWIED/Text-CSV_XS-0.23/CSV_XS.pm
http://search.cpan.org/author/JZUCKER/DBD-CSV-0.21/lib/DBD/CSV.pm
------------------------------
Date: Sun, 14 Nov 2004 08:22:05 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Extract domain name
Message-Id: <NAEld.608258$8_6.6108@attbi_s04>
Shabam wrote:
> How do you fetch just the domain name part of a variable in a script? The
> variable can be "http://www.domain.com/blahblah/whatever/page.htm" or
> "http://sub.domain.com/blahblah/whatever/page.htm".
>
> What I need is to extract just the "domain.com".
The problem is not well defined.
For "http://www.tacp.toshiba.com/" do you want "tacp.toshiba.com" or just
"toshiba.com"? For "http://story.news.yahoo.com", is "news" included or not?
You can't just use the last two components in all cases, such as
"http://www.toyota.co.jp" or "http://www.bbc.co.uk".
-Joe
------------------------------
Date: Sun, 14 Nov 2004 11:03:04 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 3.1: How do I do (anything)?
Message-Id: <cn7e18$r6l$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
3.1: How do I do (anything)?
Have you looked at CPAN (see perlfaq2)? The chances are that someone has
already written a module that can solve your problem. Have you read the
appropriate manpages? Here's a brief index:
Basics perldata, perlvar, perlsyn, perlop, perlsub
Execution perlrun, perldebug
Functions perlfunc
Objects perlref, perlmod, perlobj, perltie
Data Structures perlref, perllol, perldsc
Modules perlmod, perlmodlib, perlsub
Regexes perlre, perlfunc, perlop, perllocale
Moving to perl5 perltrap, perl
Linking w/C perlxstut, perlxs, perlcall, perlguts, perlembed
Various http://www.cpan.org/misc/olddoc/FMTEYEWTK.tgz
(not a man-page but still useful, a collection
of various essays on Perl techniques)
A crude table of contents for the Perl manpage set is found in perltoc.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Sat, 13 Nov 2004 23:56:14 -0600
From: Lars Eighner <eighner@io.com>
Subject: Re: file attachment not working properly.
Message-Id: <slrncpdsq1.2lgq.eighner@goodwill.io.com>
In our last episode, <20041113230110.14229.00000666@mb-m13.aol.com>,
the lovely and talented Mortgageloan2004 broadcast on
comp.lang.perl.misc:
> I posted this before. Please don't REMOVE my posting again.
Please learn to use your newsreader. Nothing has been removed.
--
Lars Eighner -finger for geek code- eighner@io.com http://www.io.com/~eighner/
If it wasn't for muscle spasms, I wouldn't get any exercise at all.
------------------------------
Date: Sun, 14 Nov 2004 01:16:21 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: file attachment not working properly.
Message-Id: <slrncpe1i4.eeo.tadmc@magna.augustmail.com>
Mortgageloan2004 <mortgageloan2004@aol.com> wrote:
> I posted this before. Please don't REMOVE my posting again.
Nobody but you can remove ("cancel" actually) your posts.
Did you cancel an article?
> I've spent 5
> hours of my time today working on my program.
And that affects us how?
> The second posting was an
> accident.
Then you should cancel that post (whichever one you meant).
> I paid a guy $50 for his work which did work, until I changed a few
> things.
How much does he want to repair what you've broken?
> I appreciate any help which you can shed on this script.
It is rather amateurishly written.
> #!/usr/bin/perl
#!/usr/bin/perl
use warnings;
use strict;
> use CGI::Carp qw(fatalsToBrowser);
That is handy for *debugging*.
You almost certainly want to take that out for production though.
> my $email = $_[0];
> my $from = $_[1];
> my $subject = $_[2];
> my $message = $_[3];
> my $file = $_[4];
You can replace those 5 statements with 1 statement:
my( $email, $from, $subject, $message, $file ) = @_;
> ($date,$boundary) = &boundary;
^
^
You almost certainly do not want to call subroutines that way,
see perlsub.pod for why not, and then call them this way instead:
boundary();
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 14 Nov 2004 02:50:03 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: file attachment not working properly.
Message-Id: <pan.2004.11.14.07.50.01.866963@fastmail.us>
On Sun, 14 Nov 2004 04:01:10 +0000, Mortgageloan2004 wrote:
> I posted this before. Please don't REMOVE my posting again. I've spent 5
> hours of my time today working on my program. The second posting was an
> accident. I paid a guy $50 for his work which did work, until I changed a few
> things. I'm am not a proficient programmer, though I know perl to a certain
> extant and know how to get around the directory structure of my host.
<snip>
If you paid someone for the script, then you should go back and get your
money's worth from the guy or find someone who knows what they are doing
-or- *read* the post about using the examples provided in the CGI and
MIME::Lite documentation
(Message-ID: <Xns95A0DF16E4ECFasu1cornelledu@132.236.56.8>).
They will do what you want and you'll save yourself some money.
Jim
------------------------------
Date: Sun, 14 Nov 2004 01:02:20 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: Re: Image::EXIF troubles
Message-Id: <m2lld4j4lf.fsf@gw.dd-b.net>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> writes:
> David Dyer-Bennet <dd-b@dd-b.net> wrote in news:m2u0rtjhlg.fsf@gw.dd-b.net:
>
>> Anybody else using Image::EXIF to read exposure data and such out of
>> image files from digital cameras? Or is there some other module that
>> people like better for that?
>>
>> I find its error reporting confusing or unreliable or something. I've
>> got a case where it doesn't read any data, but doesn't indicate
>> $exif->error() either; but this is under mod_perl, and *doesn't*
>> happen standalone, so it's probable running afoul of some restriction
>> there (and I've asked on the mod_perl mailing list, no responses
>> yet).
>
> Please post a short but complete script that exhibits the problem you are
> experiencing.
Here you go. Note that this runs under mod_perl; my current best info
suggests that the module Image::EXIF isn't compatible with mod_perl --
somewhere down in the underlying C utility code. I haven't chased it
that deep.
#! /usr/bin/perl
# Testing Testing Testing
use strict;
use warnings;
use Apache::Util;
use Image::EXIF;
use CGI;
use Data::Dumper;
use CGI::Carp 'fatalsToBrowser';
$CGI::POST_MAX = 5000;
$CGI::DISABLE_UPLOADS = 1;
my $q = new CGI;
my $dir = "/web/dd-b/SnapshotAlbum/data/2004/09180-Birthday";
my $fn = $dir . "/" . $q->param('fn');
die "No such file as $fn" unless -r $fn;
my @res = ();
push @res, "File: ", $fn;
my $exif = new Image::EXIF ();
$exif->file_name($fn);
push @res, $exif->error() ? $exif->errstr() : Dumper($exif->get_all_info);
print $q->header,
$q->start_html('test');
print $q->pre(join ("\n", @res));
print $q->end_html;
$exif = undef;
$q = undef;
@res = undef;
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com/> <http://www.dd-b.net/carry/>
Pics: <http://dd-b.lighthunters.net/> <http://www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Sun, 14 Nov 2004 01:04:18 -0600
From: David Dyer-Bennet <dd-b@dd-b.net>
Subject: More EXIF woes -- can Image::ExifTool return IPTC keywords as an array?
Message-Id: <m2hdnsj4i5.fsf@gw.dd-b.net>
Since Image::EXIF appears to be incompatible with mod_perl, I'm now
trying Image::ExifTool, which seems to work okay -- except I can't
figure out how to get it to return an array for the IPTC keywords
tag. It takes all the values and strings them together with commas,
which makes a real hash of it since most of my keywords are people's
names in "last, first" format. Anybody worked with ExifTool and have
any idea how to do this?
--
David Dyer-Bennet, <mailto:dd-b@dd-b.net>, <http://www.dd-b.net/dd-b/>
RKBA: <http://noguns-nomoney.com/> <http://www.dd-b.net/carry/>
Pics: <http://dd-b.lighthunters.net/> <http://www.dd-b.net/dd-b/SnapshotAlbum/>
Dragaera/Steven Brust: <http://dragaera.info/>
------------------------------
Date: Sun, 14 Nov 2004 08:03:25 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: options to shrink-wrap a perl script
Message-Id: <cn73gd$p1b$1@reader1.panix.com>
In article <Pine.LNX.4.61.0410212252140.3299@ppepc56.ph.gla.ac.uk>,
Alan J. Flavell <flavell@ph.gla.ac.uk> wrote:
>On Thu, 21 Oct 2004, A. Sinan Unur wrote:
>
>> botfood@yahoo.com (dan baker) apparently wrote something in
>news:13685ef8.0410200629.47e94ab7
>> @posting.google.com:
>>
>> Thank you for providing me with an opportunity to plonk someone.
>
>It already worked for me. Maybe you should try it more often ;-)
Geez, guys -- isn't that being just a bit rough?
(that is, assuming that "plonk" means to kill-list someone;
[due to technical reasons due being on vacation and having
to use wife's pc win2k hyperterminal to connect to my shell
acct, instead of my sun back home, can't get lynx to run
due to screen-screwup, thus can't google plonk -- sorry
] )
, just because he asked what PAR was, he got a somewhat high-handed
response -- and it escalated, small piece by small piece, from
there.
Well, let me back off a bit: you guys sure donate a *huge* amount
of time and brainpower to clpm, day after day after day -- so I guess
we mostly-lurkers here got to cut you some slack for a once-in-a-while
quick, angry response -- esp after an hours-long session of
answering all these posts!
So, from a mostly-lurker, THANK YOU ALL for all the work
you put into this group!
David
PS: just wondering -- when you *do* "plonk" someone,
is that like a death penalty (ie, permanent,
never removed), or is the general practice
to, every so often, to let them out -- but
on parole?
D.
------------------------------
Date: Sun, 14 Nov 2004 08:20:31 +0100
From: Marek Stepanek <mstep@t-online.de>
Subject: Re:backreferneces in search pattern
Message-Id: <BDBCC5CF.BBB7%mstep@t-online.de>
On 13/11/2004 16:30, in article cn592c$pms$1@sun3.bham.ac.uk, "Brian
McCauley" <nobull@mail.com> wrote:
>
> You are doing random things without understanding what you are doing.
> You can't just cut and paste fragments of code together and expect them
> to figure out how you want them to interact. You need to step back and
> learn a few basics of computer programming.
>
> The Perl <> operator reads from the process's input and print() sends
> stuff to the process's output. If you have two Perl programs written to
> process from input stream to output stream and you want to combine them
> you either have to do some adavanced trickery to redirect input and
> output or you need to actually combine them so that you read from the
> imput, do two things, then write to the output.
>
I see I abused your patience. Is their perhaps a beginners Perl-Group, where
I get some help and nobody is shouting on my silly questions ?
If somebody could point me to the right direction of the "adavanced
trickery", I will find the rest myself. Is this the right tricky direction ?
#!/usr/bin/perl -w
use strict;
use warnings;
my (@results02, %seen);
while (<>) {
no warnings qw(uninitialized);
my @results =
m!onmouseover="[^']+'([^']+)'(?:(?:(?:;\s+[^']+)'([^']+)')+)?(?:(?:[^']+)'([
^']+)')?"!g;
foreach my $i (0..$#results) {
@results02 = "'$results[$i]',\n";
}
for (@results02) {
$seen{$_}++;
}
print sort keys %seen;
}
------------------------------
Date: Sun, 14 Nov 2004 08:44:54 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Script to pass info to GET string
Message-Id: <aWEld.404617$D%.215375@attbi_s51>
Shabam wrote:
> No. I mean this whole script is running as a cgi on a web page. It takes
> the username that the user enters, and based on the domain name that the cgi
> script is running from, gets the other variable (Domain). Then, it
> redirects the user to the url
> http://www.anothersite.com/whatever.cgi?var1=Username&var2=Domain.
my $server_host = $ENV{HTTP_HOST};
(my $domain = $server_host) =~ s/^www\.//'; # Gross assumption
my $username = some basic CGI processing here.
print "$redirect_url?var1=$username;var2=$domain";
For the 'some basic CGI processing here', you should go ask in
one of the CGI newsgroups, as the solution is not perl-specific.
-Joe
------------------------------
Date: Sun, 14 Nov 2004 08:54:42 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Script to pass info to GET string
Message-Id: <m3Fld.36628$5K2.12668@attbi_s03>
Shabam wrote:
>>Oh, a stealth CGI question.
>
> I'm guessing you think I'm trying to do something bad.
Not at all. We think you're asking a basic CGI question
in a perl language newsgroup instead of in a CGI-oriented
newsgroup. That's what 'stealth CGI question' means.
We're here to help, after you've written some perl code.
You'll find that these newsgroups are not the place to go
for a beginner's guide to CGI programming.
-Joe
------------------------------
Date: Fri, 12 Nov 2004 19:47:19 +0000
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Script to pass info to GET string
Message-Id: <7jgf62-mh5.ln1@osiris.mauzo.dyndns.org>
[newsgroups trimmed]
Quoth "Shabam" <blislecp@hotmail.com>:
> > Oh, a stealth CGI question.
> > Good by then.
>
> What are you talking about? It's a simple web page cgi. User enters
> "Username", and the page takes that, along with the domain name from the
> server, and redirects the user to another script. This is being used for an
> order system for hosting, so that the user gets http://username.domain.com
> as their address. The billing system I'm using now doesn't support such a
> mechanism natively, as it accepts full domain names only. Thus I need to do
> it this way.
>
> I'm guessing you think I'm trying to do something bad. Don't assume,
> without any basis.
LOL!
No, he meant that your question was actually about CGI, but you didn't
say so. Questions like that are not welcome here: we get too many of
them, and they're not interesting.
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~ Jorge Luis Borges, 'The Babylon Lottery'
------------------------------
Date: Sun, 14 Nov 2004 05:23:50 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Using DBI for Remote myql connection
Message-Id: <GZBld.10538$_J2.2006@newsread2.news.atl.earthlink.net>
"Thelma Lubkin" <thelma@alpha2.csd.uwm.edu> wrote in message
news:cn454j$pkc$1@uwm.edu...
> I have only Perl on my home system. I would like to connect to a mysql
> database at a system that doesn't have Perl.
If you're using a Windows system, you might try IndigoPerl, available free
from www.indigostar.com. IndigoPerl has had mysql support since Build 05
Aug 28, 2000. The Dynamic Perl Console gives you an excellent viewer for all
of the installed documentation. See the documentation for DBI and DBD::mysql
for
relevant examples.
Cheers.
--
Bill Segraves
------------------------------
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 7403
***************************************