[17678] in Perl-Users-Digest
Perl-Users Digest, Issue: 5098 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 13 06:05:35 2000
Date: Wed, 13 Dec 2000 03: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)
Message-Id: <976705510-v9-i5098@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 13 Dec 2000 Volume: 9 Number: 5098
Today's topics:
Re: 404 - Location Header spcman@my-deja.com
Re: =~ operator (Rafael Garcia-Suarez)
CGI Question <mikelin6@home.com>
Re: CGI Question <josef.moellers@fujitsu-siemens.com>
Re: CGI Question <schneider@xtewa.de>
Check CDRom Status with perl <barna@megapage.ch>
Cookie Problem <dianne@dogmac.com>
Re: easy question <ng@fnmail.com>
Re: easy question <schneider@xtewa.de>
Re: FAQ 4.72: How do I define methods for every class <johnlin@chttl.com.tw>
got problem installing tk <nobody@nowhere.net>
Re: How to put each line of a text area into a field nobull@mail.com
Re: How to put each line of a text area into a field <perry@in4me.tv>
Is it possible to Send mail after every 6 & 12 submissi <fabian@markisspecialisten.com>
Is there an overhead using long variable names? (Philip Lees)
Re: local functions <bart.lateur@skynet.be>
mime decoding <hoarau@cybercable.fr>
Re: Passing parameter to CGI in webpage link nobull@mail.com
Perl type regular expression wanted shankar_krec@my-deja.com
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (John Stanley)
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Rafael Garcia-Suarez)
Re: Printing Vertically (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 13 Dec 2000 07:45:18 GMT
From: spcman@my-deja.com
Subject: Re: 404 - Location Header
Message-Id: <9179ee$10l$1@nnrp1.deja.com>
Thanks jeff, just pasted in the code and it worked perfectly. Thanks
again - Al
In article <3A369C08.B0916F63@vpservices.com>,
Jeff Zucker <jeff@vpservices.com> wrote:
> spcman@my-deja.com wrote:
> >
> > ... if i add this to error.cgi...
> > ################################################
> > #!/usr/local/bin/perl
> > print "location:http://www.someaddress.com\n\n";
> > ################################################
> > I am expecting the browser to read the location header and go on to
the
> > http://www.someadress.com, but it does not work.
> >
> > Im thinking its because along with the location headers, its also
> > returning a 404 error.
> >
> > Now my question:
> > Is their any way i can change it so the webserver outputs a (200??)
> > header so the browser reads the location header?
>
> This code:
>
> -- start of script--
> #!/usr/local/bin/perl -w
> use CGI qw(:standard);
> print redirect("http://foo.edu/");
> -- end of script --
>
> Produces this:
>
> -- start of output --
> Status: 302 Moved
> location: http://foo.edu/
>
> -- end of output --
>
> Get the idea?
>
> --
> Jeff
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 13 Dec 2000 08:21:24 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: =~ operator
Message-Id: <slrn93ece4.6m9.rgarciasuarez@rafael.kazibao.net>
Martin Schmidt wrote in comp.lang.perl.misc:
> Newbie question...
> What is the =~ operator called?
> I'm reading 'Learning Perl' and they just call it the
> =~ operator.
I once heard a frech developer call it the "têtard" -- the french
word for "tadpole".
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Wed, 13 Dec 2000 08:47:40 GMT
From: Mike Lin <mikelin6@home.com>
Subject: CGI Question
Message-Id: <3A373933.B82054A9@home.com>
Hi, I need to create a script that takes someone's email address (the
input) and creates a random number or code. This means that every time
that I enter in this same email address I will get the same "random"
code.
Basically, I need to do this for the web site that I'm working on where
the user enter in their name and email and then I email them a randomly
generated code. Then they used this code on the download page on the
website to download a file.
You see this type of CGI script all the time with those promotional
offers that ask you for your email then they email you some type of
promotional code for dollars of a purchase. If anybody has this code
available please let me know. (email me if possible)
Else please guide me through how to do it. I am currently a college CS
junior and have limited experience programming.
So far the only solution I can come up with is to generate a number
using rand. (this is the repeatable random number function right).
Then I would store the email address as the key and the repeatable
random number as the value. Does this sound good?
Also, on the other side. How do I create a web page that will only let
you download a file if you enter the right code? I was thinking about
keeping a permanent file of codes (the one's generated by using the
email addresses). Then I would use a CGI search script to look to see
if the code was on the list. If it was download would proceed.
Please let me know if this is the best way (or better yet if the script
is already available online please point me to it) I've already spent a
couple of hours trying to get this to work to no avail. (Just learned
PERL yesterday though but fortunately i already know html)
Thanks
Mike Lin
------------------------------
Date: Wed, 13 Dec 2000 10:37:15 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: CGI Question
Message-Id: <3A37434B.83703356@fujitsu-siemens.com>
Mike Lin wrote:
> =
> Hi, I need to create a script that takes someone's email address (the
> input) and creates a random number or code. This means that every time=
> that I enter in this same email address I will get the same "random"
> code.
> =
> Basically, I need to do this for the web site that I'm working on where=
> the user enter in their name and email and then I email them a randomly=
> generated code. Then they used this code on the download page on the
> website to download a file.
> =
> You see this type of CGI script all the time with those promotional
> offers that ask you for your email then they email you some type of
> promotional code for dollars of a purchase. If anybody has this code
> available please let me know. (email me if possible)
> =
> Else please guide me through how to do it. I am currently a college CS=
> junior and have limited experience programming.
> =
> So far the only solution I can come up with is to generate a number
> using rand. (this is the repeatable random number function right).
> Then I would store the email address as the key and the repeatable
> random number as the value. Does this sound good?
I'm no web expert, but I suggest you use crypt to generate a code from
the email address or host address. That way you can use two characters
(the salt) to add some more variance.
Of course, you can use any other encryption software to encrypt the
email address using some secret key of your own.
> Also, on the other side. How do I create a web page that will only let=
> you download a file if you enter the right code? I was thinking about
> keeping a permanent file of codes (the one's generated by using the
> email addresses). Then I would use a CGI search script to look to see
> if the code was on the list. If it was download would proceed.
Just let the user call another script which will check whether the
user's email address (or host address) would encrypt to the code the
user gives.
Also, you could somehow store the generated codes in some data structure
(directory tree? Database file?) and purge them after a few days. If
your user hasn't downloaded the data within 2 weeks, he needs to contact
you. This prevents others from randomly trying or re-using that
customer's code.
Again, I'm not an expert.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
Date: Wed, 13 Dec 2000 10:24:12 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: CGI Question
Message-Id: <917io8$8b5$1@nnrp1.deja.com>
> Hi, I need to create a script that takes someone's email address (the
> input) and creates a random number or code. This means that every
time
> that I enter in this same email address I will get the same "random"
> code.
My idea [and I bet there will be postings telling me how bad bad bad
that idea was - but works! :)] would be to seed srand() with the email-
address:
srand("nobody@nothing.com");
AFAIK, this should always generate the same "random" numbers if you
rand() afterwards ...
And you can use it vice versa to verify the user. Just seed srand()
with the provided email address and compare the rand() output with what
the user entered.
This is just an idea and I am sure there a better ways to do it.
But maybe this helps you to find that better way ... :)
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 13 Dec 2000 09:41:18 +0100
From: Barna <barna@megapage.ch>
Subject: Check CDRom Status with perl
Message-Id: <3A37362E.B4402202@megapage.ch>
Hi All
How can I check, if the CDRom is opened (open/close) with Perl (in
Win32)?
Is there a trick or something, how I can do it without a module, or what
do I need?
Thanks to everyone!
Bye
------------------------------
Date: Wed, 13 Dec 2000 16:34:43 +1100
From: "Dianne van Dulken" <dianne@dogmac.com>
Subject: Cookie Problem
Message-Id: <jTDZ5.423$%v1.11384@ozemail.com.au>
Hi all,
I was wondering if someone might be able to help
I am setting a cookie in perl, to expire in half an hour, if someone wants
high security (a year otherwise). All it records is the username, which
can be readily
In my dev environment, where both the secure and insecure servers are the
same, this works fine. Come 30 minutes, no more cookie.
On my test environment, it stops working - in that it doesn't expire when I
think it should. Half an hour clicks by and no expiry at all. I assume
that it is probably setting it to be never expiry, or a year. I am
beginning to think this must have something to do with the IP, as there is
nothing else in the code that I can see as being wrong. The only difference
here between the secure and insecure servers is one is http:// and one is
https://
Has anyone encountered this before, and if so, how did they fix it?
My code is below, in case there is something in that.
Thanks a lot
Dianne
______________________________________________________________
sub Set_Cookies
{
# Format for cookie Expiry date is : 'Tue, 01-Jan-2002 01:01:01 GMT';
my
@months=("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","
Dec");
my @days=("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
# Set up expiry date of 1 hour
my ($sec, $min, $hr, $endday, $mon, $year, $wday, $yday, $isdst) =
gmtime(time + 600);
$yy = $year + 1900;
my $month = $months[$mon];
my $day = $days[$wday];
$expdate_short = sprintf("%3s, %.2d-%3s-%4d %.2d:%.2d:%.2d GMT", $day,
$endday, $month, $yy, $hr, $min, $sec);
# Expiry date of 1 year
($sec, $min, $hr, $endday, $mon, $year, $wday, $yday, $isdst) =
gmtime(time + (3600 * 24 * 365));
$yy = $year + 1900;
$month = $months[$mon];
$day = $days[$wday];
$expdate_long = sprintf("%3s, %.2d-%3s-%4d %.2d:%.2d:%.2d GMT", $day,
$endday, $month, $yy, $hr, $min, $sec);
$Cookie_Path="/";
# Sure we don't need these next 2 lines..
$Cookies{'account_no'} = $account_no;
$Cookies{'subscriber_id'} = $subscriber_id;
@cookie_temp =
("account_no","$account_no","subscriber_id","$subscriber_id");
&SetCompressedCookies("SESSION_COOKIES", @cookie_temp);
# Only put email address into permanent cookie if user selected standard
security
if ($security eq "S") {
# $Cookie_Exp_Date='Fri, 01-Jan-2010 01:01:01 GMT';
$Cookie_Exp_Date=$expdate_long;
$Cookie_Path="/";
&SetCookies("username","$username");
}
else {
$Cookie_Exp_Date=$expdate_short;
$Cookie_Path="/";
&SetCookies("username","$username");
}
}
(The following is from a cookies lib)
sub SetCookies
{
# Localize variables and read in cookies to be set.
#
local(@cookies) = @_;
local($cookie,$value,$char);
# While there is a cookie and a value to be set in @cookies, that hasn't
#
# yet been set, proceed with the loop.
#
while( ($cookie,$value) = @cookies ) {
# We must translate characters which are not allowed in cookies.
#
foreach $char (@Cookie_Encode_Chars) {
$cookie =~ s/$char/$Cookie_Encode_Chars{$char}/g;
$value =~ s/$char/$Cookie_Encode_Chars{$char}/g;
}
# Begin the printing of the Set-Cookie header with the cookie name
#
# and value, followed by semi-colon.
#
print 'Set-Cookie: ' . $cookie . '=' . $value . ';';
# If there is an Expiration Date set, add it to the header.
#
if ($Cookie_Exp_Date) {
print ' expires=' . $Cookie_Exp_Date . ';';
}
# If there is a path set, add it to the header.
#
if ($Cookie_Path) {
print ' path=' . $Cookie_Path . ';';
}
# If a domain has been set, add it to the header.
#
if ($Cookie_Domain) {
print ' domain=' . $Cookie_Domain . ';';
}
# If this cookie should be sent only over secure channels, add that
#
# to the header.
#
if ($Secure_Cookie) {
print ' secure';
}
# End this line of the header, setting the cookie.
#
print "\n";
# Remove the first two values of the @cookies array since we just
#
# used them.
#
shift(@cookies); shift(@cookies);
}
}
------------------------------
Date: Tue, 12 Dec 2000 23:54:29 -0600
From: "Enrico Ng" <ng@fnmail.com>
Subject: Re: easy question
Message-Id: <9172up$a6h$1@info1.fnal.gov>
so anyways
This is probably a very easy question, but I have never done this before.
I am making a webpage for a small TV station.
it would have a place you can vote about certain shows.
and another place that shows what is showing now, and what will be on the
next three hours.
I was hopeing to use a SSI exec directive so I could split it up into a vote
script and a schedule script.
The server I am using prohibits SSI exec use, other SSI is ok although.
so I figure I will need to make a script that takes certain arguments for
loading pages.
so I can add the vote thing on each page and generate the schedule.
MY QUESTION IS:
is there an easy way I can do this?
ie. have a script called schedule.pl that generates a schedule depending on
what time it is.
then have my load.pl script that loads a page and adds that in.
can I "call" a perl script from within a perl script?
thanx
--
Enrico Ng <ng@fnmail.com>
------------------------------
Date: Wed, 13 Dec 2000 10:02:39 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: easy question
Message-Id: <917hft$7h8$1@nnrp1.deja.com>
> MY QUESTION IS:
> is there an easy way I can do this?
probably
> can I "call" a perl script from within a perl script?
yes - just search this forum for it. There have been a lot of postings
about that recently ...
> then have my load.pl script that loads a page and adds that in.
What I would do is create a html-document and use special tags wherever
you want to have data replaced.
e.g.
<FONT SIZE=-1 FACE="Arial"><!TITLE!></FONT>
So you would read the document and replace every occurence of <!TITLE!>
with the actual title.
I hope I didn't miss the point :)
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 13 Dec 2000 16:30:21 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: FAQ 4.72: How do I define methods for every class/object?
Message-Id: <917c7b$l7@netnews.hinet.net>
> How do I define methods for every class/object?
> Use the UNIVERSAL class (see the UNIVERSAL manpage).
No. I can't see any single line of
perldoc UNIVERSAL
is talking about and answering this question. The document is just
talking about the methods provided by UNIVERSAL.
Do you mean (let me try)...
sub UNIVERSAL::foo { 'hello' }
my $object = bless [],'AnyClass';
print $object->foo;
Oops, it works.
OK. Now I understand how to define methods for every class.
John Lin
------------------------------
Date: Wed, 13 Dec 2000 18:44:43 +0800
From: "»´ä¸}" <nobody@nowhere.net>
Subject: got problem installing tk
Message-Id: <917k6j$nf5$1@taliesin.netcom.net.uk>
##### i type in perl makefile.pl in win32 dos , and recieved
PPM for perl5.006
Test Compiling config/signedchar.c
C:\Perl\bin\Perl.exe is installed in C:\Perl\lib okay
Bad command or file name
Test Compiling config/Ksprintf.c
Bad command or file name
Skip InputO on MSWin32
Skip Mwm on MSWin32
Skip WinPhoto on MSWin32
Generating Dependencies for MSWin32, win_arch=MSWin32
Loose imgPmap.h
Loose imgUnixPmap.c
Test Compiling config/Hstrtoul.c
Bad command or file name
Test Compiling config/Hstrdup.c
Bad command or file name
Test Compiling config/Hstrcasecmp.c
Bad command or file name
Extracting imgPmap.h
Extracting imgUnixPmap.c
Usage: xsubpp [-v] [-C++] [-except] [-prototypes] [-noversioncheck]
[-nolinenumbers] [-nooptimize] [-noinout] [-noargtypes] [-s pattern]
[-typemap typemap]... file.xs
Finding dependancies for ClientWin.c
Finding dependancies for Lang_f.c
Finding dependancies for Xlib_f.c
Finding dependancies for XrmOption.c
Finding dependancies for exWinHandle.c
Finding dependancies for imgBMP.c
Finding dependancies for imgGIF.c
Finding dependancies for imgInit.c
Finding dependancies for imgInt_f.c
Finding dependancies for imgObj.c
Finding dependancies for imgUnixPmap.c
Finding dependancies for imgUtil.c
Finding dependancies for imgWindow.c
Finding dependancies for imgXBM.c
Finding dependancies for imgXPM.c
Finding dependancies for ptkCanvGrid.c
Finding dependancies for ptkCanvGroup.c
Finding dependancies for stbDItem.c
Finding dependancies for stbDashCustom.c
Finding dependancies for stbDiStyle.c
Finding dependancies for stubs.c
Finding dependancies for tclAsync.c
Finding dependancies for tclEvent.c
Finding dependancies for tclHash.c
Finding dependancies for tclNotify.c
Finding dependancies for tclPreserve.c
Finding dependancies for tclTimer.c
Finding dependancies for tclWinNotify.c
Finding dependancies for tclWinTime.c
Finding dependancies for tixCompat.c
Finding dependancies for tixDItem.c
Finding dependancies for tixDiITxt.c
Finding dependancies for tixDiImg.c
Finding dependancies for tixDiStyle.c
Finding dependancies for tixDiText.c
Finding dependancies for tixDiWin.c
Finding dependancies for tixError.c
Finding dependancies for tixForm.c
Finding dependancies for tixFormMisc.c
Finding dependancies for tixGrData.c
Finding dependancies for tixGrFmt.c
Finding dependancies for tixGrRC.c
Finding dependancies for tixGrSel.c
Finding dependancies for tixGrSort.c
Finding dependancies for tixGrUtl.c
Finding dependancies for tixGrid.c
Finding dependancies for tixHLCol.c
Finding dependancies for tixHLHdr.c
Finding dependancies for tixHLInd.c
Finding dependancies for tixHList.c
Finding dependancies for tixImgCmp.c
Finding dependancies for tixImgXpm.c
Finding dependancies for tixImgXpm_f.c
Finding dependancies for tixInputO.c
Finding dependancies for tixInt_f.c
Finding dependancies for tixList.c
Finding dependancies for tixNBFrame.c
Finding dependancies for tixScroll.c
Finding dependancies for tixSmpLs.c
Finding dependancies for tixTList.c
Finding dependancies for tixUtils.c
Finding dependancies for tixVars.c
Finding dependancies for tixWinDraw.c
Finding dependancies for tixWinXpm.c
Finding dependancies for tix_f.c
Finding dependancies for tk3d.c
Finding dependancies for tkAtom.c
Finding dependancies for tkBind.c
Finding dependancies for tkBitmap.c
Finding dependancies for tkButton.c
Finding dependancies for tkCanvArc.c
Finding dependancies for tkCanvBmap.c
Finding dependancies for tkCanvImg.c
Finding dependancies for tkCanvLine.c
Finding dependancies for tkCanvPoly.c
Finding dependancies for tkCanvPs.c
Finding dependancies for tkCanvText.c
Finding dependancies for tkCanvUtil.c
Finding dependancies for tkCanvWind.c
Finding dependancies for tkCanvas.c
Finding dependancies for tkClipboard.c
Finding dependancies for tkCmds.c
Finding dependancies for tkColor.c
Finding dependancies for tkConfig.c
Finding dependancies for tkCursor.c
Finding dependancies for tkEntry.c
Finding dependancies for tkError.c
Finding dependancies for tkEvent.c
Finding dependancies for tkEvent_f.c
Finding dependancies for tkFileFilter.c
Finding dependancies for tkFocus.c
Finding dependancies for tkFont.c
Finding dependancies for tkFrame.c
Finding dependancies for tkGC.c
Finding dependancies for tkGeometry.c
Finding dependancies for tkGet.c
Finding dependancies for tkGrab.c
Finding dependancies for tkGrid.c
Finding dependancies for tkImage.c
Finding dependancies for tkImgBmap.c
Finding dependancies for tkImgPPM.c
Finding dependancies for tkImgPhoto.c
Finding dependancies for tkImgPhoto_f.c
Finding dependancies for tkImgUtil.c
Finding dependancies for tkInt_f.c
Finding dependancies for tkListbox.c
Finding dependancies for tkMacWinMenu.c
Finding dependancies for tkMenu.c
Finding dependancies for tkMenuDraw.c
Finding dependancies for tkMenubutton.c
Finding dependancies for tkMessage.c
Finding dependancies for tkOption.c
Finding dependancies for tkOption_f.c
Finding dependancies for tkPack.c
Finding dependancies for tkPlace.c
Finding dependancies for tkPointer.c
Finding dependancies for tkProperty.c
Finding dependancies for tkRectOval.c
Finding dependancies for tkScale.c
Finding dependancies for tkScrollbar.c
Finding dependancies for tkSelect.c
Finding dependancies for tkSquare.c
Finding dependancies for tkText.c
Finding dependancies for tkTextBTree.c
Finding dependancies for tkTextDisp.c
Finding dependancies for tkTextImage.c
Finding dependancies for tkTextIndex.c
Finding dependancies for tkTextMark.c
Finding dependancies for tkTextTag.c
Finding dependancies for tkTextWind.c
Finding dependancies for tkTrig.c
Finding dependancies for tkUnixMenubu.c
Finding dependancies for tkUnixScale.c
Finding dependancies for tkUtil.c
Finding dependancies for tkVisual.c
Finding dependancies for tkWin3d.c
Finding dependancies for tkWinButton.c
Finding dependancies for tkWinClipboard.c
Finding dependancies for tkWinColor.c
Finding dependancies for tkWinCursor.c
Finding dependancies for tkWinDialog.c
Finding dependancies for tkWinDraw.c
Finding dependancies for tkWinEmbed.c
Finding dependancies for tkWinFont.c
Finding dependancies for tkWinImage.c
Finding dependancies for tkWinInt_f.c
Finding dependancies for tkWinKey.c
Finding dependancies for tkWinMenu.c
Finding dependancies for tkWinPixmap.c
Finding dependancies for tkWinPointer.c
Finding dependancies for tkWinRegion.c
Finding dependancies for tkWinScrlbr.c
Finding dependancies for tkWinSend.c
Finding dependancies for tkWinWindow.c
Finding dependancies for tkWinWm.c
Finding dependancies for tkWinX.c
Finding dependancies for tkWin_f.c
Finding dependancies for tkWindow.c
Finding dependancies for tk_f.c
Finding dependancies for xcolors.c
Finding dependancies for xdraw.c
Finding dependancies for xgc.c
Finding dependancies for ximage.c
Finding dependancies for xutil.c
Finding dependancies for X.xs
Finding dependancies for Xlib.xs
Finding dependancies for Pixmap.xs
Finding dependancies for TixGrid.xs
Finding dependancies for Text.xs
Finding dependancies for TList.xs
Finding dependancies for Scrollbar.xs
Finding dependancies for Scale.xs
Finding dependancies for Photo.xs
Finding dependancies for NBFrame.xs
Finding dependancies for Menubutton.xs
Finding dependancies for Listbox.xs
Finding dependancies for IO.xs
Finding dependancies for HList.xs
Finding dependancies for Event.xs
Finding dependancies for pTkCallback.c
Finding dependancies for tclEvent.c
Finding dependancies for tclNotify.c
Finding dependancies for tclPlatEvent.c
Finding dependancies for tclPlatNotfy.c
Finding dependancies for tclPlatTime.c
Finding dependancies for tclTimer.c
Finding dependancies for tkWin32Dll.c
Finding dependancies for Entry.xs
Finding dependancies for Win32Site.xs
Finding dependancies for Compound.xs
Finding dependancies for Canvas.xs
Finding dependancies for Bitmap.xs
Finding dependancies for Tk.xs
Finding dependancies for chnGlue.c
Finding dependancies for evtGlue.c
Finding dependancies for objGlue.c
Finding dependancies for tixGlue.c
Finding dependancies for tkGlue.c
Finding dependancies for tkGlue_f.c
Finding dependancies for tkWin32Dll.c
Writing Makefile for Tk::pTk
Writing Makefile for Tk::pod
Writing Makefile for Tk::demos
Writing Makefile for Tk::X
Writing Makefile for Tk::Xlib
Writing Makefile for Tk::Tixish
Writing Makefile for Tk::Pixmap
Writing Makefile for Tk::TixGrid
Writing Makefile for Tk::TextList
Writing Makefile for Tk::Text
Writing Makefile for Tk::TList
Writing Makefile for Tk::Scrollbar
Writing Makefile for Tk::Scale
Writing Makefile for Tk::Photo
Writing Makefile for Tk::NBFrame
Writing Makefile for Tk::Menubutton
Writing Makefile for Tk::Listbox
Writing Makefile for Tk::IO
Writing Makefile for Tk::HList
Writing Makefile for Tk::Event
Writing Makefile for Tk::Entry
Writing Makefile for Tk::DragDrop::Win32Site
Writing Makefile for Tk::DragDrop
Writing Makefile for Tk::Compound
Writing Makefile for Tk::Canvas
Writing Makefile for Tk::Bitmap
Writing Makefile for Tk
#####then i try to hello world
#!/usr/bin/perl -w
use Tk;
my $mw = MainWindow->new;
$mw->Button(-text => "Hello World!", -command =>sub{exit})->pack;
MainLoop;
#####and i got error messages like that :
Can't locate Tk/Event.pm in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib .) at Tk.pm line 13.
BEGIN failed--compilation aborted at Tk.pm line 13.
Compilation failed in require at C:\TEST.PL line 2.
BEGIN failed--compilation aborted at C:\TEST.PL line 2.
what's the problem and plz anyone give me a solution
------------------------------
Date: 12 Dec 2000 22:12:41 +0000
From: nobull@mail.com
Subject: Re: How to put each line of a text area into a field
Message-Id: <u93dfsr7ek.fsf@wcl-l.bham.ac.uk>
"Perry Smit" <perry@in4me.tv> writes:
> I'm puzzling to get each line of a text area field into seperate fields.
To split a CR, CR-LF or LF delimited multiline string containing
into an array of lines:
my @lines = split (/\cM\cJ|\cM|\cJ/, $string);
> I have two textarea's. One containing fieldnames and the other contains the
> fieldvalues.
my %fields;
@fields{split (/\cM\cJ|\cM|\cJ/, $q->param('fieldnames'))}=
split (/\cM\cJ|\cM|\cJ/, $q->param('fieldvalues'));
> Now I want print this in an e-mail where each text line of the fieldname
> textarea correspondent by the fieldvalue textarea.
Sorry that sentence makes no sense.
> I've tried already this (copied rom other sources and tried and
> tried...wothj no result):-)
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
Don't do this. Stop trying to re-implement the CGI API. Never go
near that source again.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 13 Dec 2000 11:59:41 +0100
From: "Perry Smit" <perry@in4me.tv>
Subject: Re: How to put each line of a text area into a field
Message-Id: <qxIZ5.27384$fy2.1873318@news.soneraplaza.nl>
Thanks for your help,
But can't get it working. I have created the following script. I have
deleted the read(STDIN line) and can't figure out how to print the field and
fieldnames and get server errors, what goes wrong over here?
Again thanks for your help,
Perry
#!/usr/bin/perl
if ($ENV{'REQUEST_METHOD'} eq 'POST')
my @lines = split (/\cM\cJ|\cM|\cJ/, $string);
my %fields;
@fields{split (/\cM\cJ|\cM|\cJ/, $q->param('fieldnames'))}=
split (/\cM\cJ|\cM|\cJ/, $q->param('fieldvalues'));
($mon,$day,$year) = split(m|/|,`/bin/date +%B/%e/%Y`);
$date = "$mon $day, $year";
&mailto;
sub mailto
{
open (MAIL, "|/usr/sbin/sendmail -t") || die "can't open pipe to sendmail
\n";
print MAIL "Content-Type: application/x-gm-impdata\n";
print MAIL "To: $to\n";
print MAIL "Subject: datafromgoldform.pl\n";
foreach $name (sort keys %fields) {
next if $fields{$fieldnames} eq "";
print MAIL "$fieldnames = $fields{$name}\n";
}
close (MAIL)
}
<nobull@mail.com> wrote in message news:u93dfsr7ek.fsf@wcl-l.bham.ac.uk...
> "Perry Smit" <perry@in4me.tv> writes:
>
> > I'm puzzling to get each line of a text area field into seperate fields.
>
> To split a CR, CR-LF or LF delimited multiline string containing
> into an array of lines:
>
> my @lines = split (/\cM\cJ|\cM|\cJ/, $string);
>
> > I have two textarea's. One containing fieldnames and the other contains
the
> > fieldvalues.
>
> my %fields;
> @fields{split (/\cM\cJ|\cM|\cJ/, $q->param('fieldnames'))}=
> split (/\cM\cJ|\cM|\cJ/, $q->param('fieldvalues'));
>
> > Now I want print this in an e-mail where each text line of the fieldname
> > textarea correspondent by the fieldvalue textarea.
>
> Sorry that sentence makes no sense.
>
> > I've tried already this (copied rom other sources and tried and
> > tried...wothj no result):-)
>
> > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>
> Don't do this. Stop trying to re-implement the CGI API. Never go
> near that source again.
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 13 Dec 2000 09:42:39 GMT
From: "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
Subject: Is it possible to Send mail after every 6 & 12 submission.
Message-Id: <jwHZ5.3505$O%.548494@newsc.telia.net>
This is a kind of guestscript. I want to be noticed when the guestbook-file
contains 6 & 12 printed messages. Can anyone help me with the code? FAbian
if ( $FORM{'post'} && $linkmail ) {
open (FILE,"+< $guestbookreal") || die "Can't Open $guestbookreal:
$!\n";
flock FILE,2; # lock file during modification
seek FILE,0,0;
@LINES = <FILE>;
seek FILE,0,0;
truncate FILE,0;
foreach (@LINES) {
if (/<!--begin(\d*)-->/) {
my $recnum = ($1 % 3) +1;
print FILE "<!--begin$recnum-->\n" if $entry_order;
print FILE "</TR><TR>\n\n" if ($recnum == 1 && not
$entry_order);
print FILE
"<TD><br><br><br><br><B>$FORM{'foretag'}<br>$FORM{'realname'}<br>" .
"$FORM{'adress'}<br>$FORM{'post'}<br><br><br><br><br><br><br>
\n";
print FILE "</TR><TR>\n\n" if ($recnum == 1 && $entry_order);
print FILE "<!--begin$recnum-->\n" unless $entry_order;
} else {
print FILE $_;
}
}
close FILE;
}
# Log The Entry
if ($uselog eq '1') {
&log('entry');
}
------------------------------
Date: Wed, 13 Dec 2000 08:50:39 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Is there an overhead using long variable names?
Message-Id: <3a373715.67126743@news.grnet.gr>
Is there any significant time overhead when using long variable names?
e.g. $name_in_old_and_obsolete_database versus $old_name
Obviously a script full of long names will take longer to load, but
this shouldn't be significant unless the script is huge, right? What
about compilation time? The FAQ doesn't seem to address this question.
No cracks about how long it takes to type the longer names, please.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Wed, 13 Dec 2000 08:17:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: local functions
Message-Id: <a4ce3tk1ho57jlcmn9bahnhq9p04cujrop@4ax.com>
Uri Guttman wrote:
>sub foo {
> my $bar = sub {
> print "baz!\n";
> }
>
> $bar->();
>}
You forgot the semicolon right after the sub definition. I warned about
that (in another follow-up).
--
Bart.
------------------------------
Date: 13 Dec 2000 10:56:53 GMT
From: "Pascal HOARAU" <hoarau@cybercable.fr>
Subject: mime decoding
Message-Id: <917kll$83$1@news2.isdnet.net>
Hi,
I am making a site to use newsgroups through html.
You can see it at http://pascalboards.dyndns.org
I would like to decode mime file (uu,base64 and multipart).
I did that with system("munpack") or with the module convert::uu (decode only uu)
But if someone could help me to do a better job (with mime or whatever on my site)
:)
-------------------
Pascal HOARAU
STN COnsultants
------------------------------
Date: 12 Dec 2000 22:22:37 +0000
From: nobull@mail.com
Subject: Re: Passing parameter to CGI in webpage link
Message-Id: <u91yvcr7dg.fsf@wcl-l.bham.ac.uk>
Paula Powell Sapienza <p_sapienza@hotmail.com> writes:
> How does one pass a command-line (or otherwise) parameter to a Perl
> script? Say, from a link in a webpage? (i.e., <a href="mything.cgi?4">)
Yes, you guessed right.
Why didn't you simply try it before you posted?
This has nothing whatever to do with Perl, it is a pure CGI question.
Please post only Perl-related questions here.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 13 Dec 2000 09:57:34 GMT
From: shankar_krec@my-deja.com
Subject: Perl type regular expression wanted
Message-Id: <917h6c$76u$1@nnrp1.deja.com>
The problem:
T-SQL (Microsoft SQL) strings are delimited by single quotes (') . If u
need
to include a single quote as a part of the string, u need to escape that
by
a single quote immediately preceding it (like we use a double backslash
(\\)
to include a backslash in a string in C). I need to write a regular
expression to find all such strings.
For example:
1. print ('''hello''') would print the string ('hello') (including
quotes)
2. ''' ,' is the string (', ') (including quotes)
3. print ('hello') would print hello (no quotes)
NOTE: dont expect whitespace on either side of the delimiters. This is
the
most important restriction, I feel
Please Help if u know solution..
My conclusion:
I think its basically a problem of finding a string like this:
if you encounter a single quote, count till you have an even number of
single quotes and the last quote so counted is not followed by another
single count.... SO u basically need a CFL, an RE wont work.. or maybe
LEX-type state-variables... not sure of that....
U'rs truly,
shankar
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 13 Dec 2000 05:39:12 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <917220$a7o$1@news.NERO.NET>
>On Tue, 12 Dec 2000, tadmc@metronet.com wrote:
>> =back
>>
>> It is B<not> required, or even expected, that you actually I<read>
This is a discussion newsgroup, not a pod newsgroup nor a TeX newsgroup
nor an HTML newsgroup. It's a bit disengenuous to claim that HTML is not
welcome here while posting a FAQ in a non-standard (to the rest of the
world) markup language. HTML has the great advantage that many
newsreaders process it natively; I know of no pod-based newsreader.
>> It is standard 'netiquette to monitor (lurk) a newsgroup for a few
What is the ' for?
>> You can "power lurk" by reading 20-30 posts a day for the last
>> several days at a Usenet archive.
You can read them on any well-configured news server, as well.
>> There can be 200 messages in clpm in a single day. Nobody is going
>> to read every article. So they must decide somehow which articles
>> they are going to read, and which they will skip.
Second sentence is a fragment. Start with "They".
>> It is understood that you may not know that the root of your problem
>> is not Perl-related (the two most frequent ones are CGI and
>> Operating System related). So off-topic postings will happen from
>> time to time. Be gracious when someone helps you find a better
"so" introduces a clause. Either "related), so ..." or "Off-topic..."
>> place to ask your question by pointing you to a more applicable
>> newsgroup.
Most people are not gracious when pointing someone to another group, so
I question the claim that "it is understood". I also question the demand
that someone be gracious when faced with a lack of same.
------------------------------
Date: Wed, 13 Dec 2000 08:13:08 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <slrn93ebuk.6m9.rgarciasuarez@rafael.kazibao.net>
Tad McClellan wrote in comp.lang.perl.misc:
> Rafael Garcia-Suarez <rgarciasuarez@free.fr> wrote:
> >"Note that CGI programs issue their error messages in the webserver's
> >error logfile."
>
> I don't want to put application-specific stuff in here. That has
> nothing to do with Perl.
Well, you're probably right. Anyway, it's better to tell posters that
they should test their scripts from the command-line. I was just tired
to repeat "and what does the error log say?"
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 13 Dec 2000 09:14:52 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Printing Vertically
Message-Id: <slrn93efgc.9uu.abigail@tsathoggua.rlyeh.net>
On Tue, 12 Dec 2000 21:45:34 -0500, Jeff Pinyan (jeffp@crusoe.net) wrote in comp.lang.perl.misc <URL: news:<Pine.GSO.4.21.0012122144510.19179-100000@crusoe.crusoe.net>>:
++
++ s/(?<!^)/\n/g;print;
++
Saving 3 strokes:
s/./$&\n/g;print;
Abigail
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 5098
**************************************