[22026] in Perl-Users-Digest
Perl-Users Digest, Issue: 4248 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 11 11:05:45 2002
Date: Wed, 11 Dec 2002 08:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 11 Dec 2002 Volume: 10 Number: 4248
Today's topics:
Can anyone help me in this..... (TD)
Re: Can't find MakeRegex.pm (Anno Siegel)
Re: debug in cgi environment (indigoperl) ? (Peter Scott)
Determining file sizes <md0nilhe@mdstud.DIESPAMchalmers.se>
Re: Determining file sizes (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
Re: Determining file sizes <nobody@dev.null>
Re: Determining file sizes (Tad McClellan)
Get current date / time? <jon@rogers.tv>
Re: Get current date / time? <kha2536@rogers.com>
Re: Get current date / time? (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
Re: gtk-perl <zentara@highstream.net>
Re: hidden eval variables <GPatnude@adelphia.net>
Re: hidden eval variables (Anno Siegel)
Re: How does HTML encodes GET and POST requests? <simon.oliver@nospam.umist.ac.uk>
Re: Max fork'd proc limit...? <raffles2@att.net>
Re: Newbie question <ihave@noemail.com>
Re: Passing an object to another object <ubl@schaffhausen.de>
Re: Passing an object to another object <tassilo.parseval@post.rwth-aachen.de>
Re: perl bad interpreter: No such file or directory (Stas Neuberger)
scorefile/killfile (was Re: Comparison confusion) (Tad McClellan)
Re: which UI for Perl? <rootmj@seznam.cz>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Dec 2002 06:18:42 -0800
From: tushar08@yahoo.com (TD)
Subject: Can anyone help me in this.....
Message-Id: <584a8362.0212110618.33d0d48e@posting.google.com>
Does any one have a best way to solve such kind of problems....
tushar08@yahoo.com (TD) wrote in message news:<584a8362.0212101003.44d0652d@posting.google.com>...
> Hello all,
>
>
> I have some problem with memory leak in my perl programs. Is there any
> url where I can get a binary distribution of perl that is compiled
> with mtrace built in it. I went thru perlguts/perldebug/perldebguts it
> says you need to have perl version that can do memory footprint
> debugging. I tried Devel::Peek and tried to use mstat() it did not
> worked.
>
> Can anyone please advise. Thanks in advance
>
> PERL version
> Summary of my perl5 (revision 5 version 6 subversion 1) configuration:
> Platform:
> osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
> uname=''
> config_args='undef'
> hint=recommended, useposix=true, d_sigaction=undef
> usethreads=undef use5005threads=undef useithreads=define
> usemultiplicity=define
> useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef
> use64bitint=undef use64bitall=undef uselongdouble=undef
> Compiler:
> cc='cl', ccflags ='-nologo -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE
> -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT
> -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX',
> optimize='-O1 -MD -DNDEBUG',
> cppflags='-DWIN32'
> ccversion='', gccversion='', gccosandvers=''
> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
> d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
> ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
> lseeksize=4
> alignbytes=8, usemymalloc=n, prototype=define
> Linker and Libraries:
> ld='link', ldflags ='-nologo -nodefaultlib -release
> -libpath:"C:/Perl\lib\CORE" -machine:x86'
> libpth="D:\Program Files\Microsoft Visual Studio
> .NET\FrameworkSDK\Lib\" "C:\Perl\lib\CORE"
> libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
> comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
> netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib
> odbc32.lib odbccp32.lib msvcrt.lib
> perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib
> winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
> oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib
> version.lib odbc32.lib odbccp32.lib msvcrt.lib
> libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl56.lib
> Dynamic Linking:
> dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
> cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
> -libpath:"C:/Perl\lib\CORE" -machine:x86'
>
>
> Characteristics of this binary (from libperl):
> Compile-time options: MULTIPLICITY USE_ITHREADS
> PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
> Locally applied patches:
> ActivePerl Build 633
> Built under MSWin32
> Compiled at Jun 17 2002 21:33:05
> %ENV:
> PERL5LIB="c:\dev_apps\lib;c:\dev_apps\mapper\lib2;c:\dev_apps\ezemail\src;c:\dev_apps\mapper\app\DU\src;c:\dev_apps\ezspam\src;."
> PERLDB_OPTS="RemotePort=127.0.0.1:2000"
> @INC:
> c:\dev_apps\lib
> c:\dev_apps\mapper\lib2
> c:\dev_apps\ezemail\src
> c:\dev_apps\mapper\app\DU\src
> c:\dev_apps\ezspam\src
> .
> C:/Perl/lib
> C:/Perl/site/lib
> .
------------------------------
Date: 11 Dec 2002 15:23:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Can't find MakeRegex.pm
Message-Id: <at7l95$co2$1@mamenchi.zrz.TU-Berlin.DE>
According to RonaldWS <ronaldws@aol.com>:
> >Googgle for it.
> >
> >Anno
> >
>
> I checked both google and askjeeves but did not find the module. If you can
> give me a link to the module or a google query that will help me find it I
> would be interested.
>
> http://www.google.com/search?q=MakeRegex.pm
>
> resulted in three dead end links.
Looking for "MakeRegex" (no .pm) finds http://hakank.fluff.com/makeregex/
Anno
------------------------------
Date: Wed, 11 Dec 2002 15:22:48 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: debug in cgi environment (indigoperl) ?
Message-Id: <cLIJ9.146522$ea.2784964@news2.calgary.shaw.ca>
In article <3DF6AA51.6401A926@attbi.com>,
Eric Osman <os7man@attbi.com> writes:
>in my case
>the input is fields on a form from a web page.
>
>How the heck do you emulate such input in order to
>test a perl file without the browser environment ?
If you are in a situation where the suggestions given by others
are insufficient (e.g., your program needs something on the
server and you do not have a login to the server, or one of your
input fields is a file upload), then about the only solution left
for interactive debugging is to use ptkdb. That's provided the
web server has X Window System client libraries for its Tk and
you are using a machine that runs an X server, and various other
caveats.
This is probably only worth the effort if you really are unable to use
command line testing.
(Hmm... I'd have thought that someone would have come up with a
way to supply a value for a file upload field as a command line
debugging input for CGI.pm by now, but I have been unable to find
such a thing.)
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: Wed, 11 Dec 2002 14:12:27 +0100
From: henrik nilsson <md0nilhe@mdstud.DIESPAMchalmers.se>
Subject: Determining file sizes
Message-Id: <3DF739BB.9070502@mdstud.DIESPAMchalmers.se>
Hi
How do I determine the file sizes, owner etc of the files in a dir?
opendir / readdir only gives me the names of the files?
Thanks,
Henrik
------------------------------
Date: 11 Dec 2002 15:18:20 +0100
From: mru@users.sourceforge.net (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
Subject: Re: Determining file sizes
Message-Id: <yw1xr8cotz9v.fsf@igloo.e.kth.se>
henrik nilsson <md0nilhe@mdstud.DIESPAMchalmers.se> writes:
> How do I determine the file sizes, owner etc of the files in a dir?
> opendir / readdir only gives me the names of the files?
stat
--
Måns Rullgård
mru@users.sf.net
------------------------------
Date: Wed, 11 Dec 2002 14:26:53 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: Determining file sizes
Message-Id: <3DF74AAF.9090608@dev.null>
henrik nilsson wrote:
> Hi
>
> How do I determine the file sizes, owner etc of the files in a dir?
Unleash the awesome power of the stat function on them.
------------------------------
Date: Wed, 11 Dec 2002 09:16:47 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Determining file sizes
Message-Id: <slrnavelmv.66h.tadmc@magna.augustmail.com>
henrik nilsson <md0nilhe@mdstud.DIESPAMchalmers.se> wrote:
> How do I determine the file sizes, owner etc of the files in a dir?
perldoc -f -X
perldoc -f stat
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 11 Dec 2002 16:45:23 +0100
From: Jon Rogers <jon@rogers.tv>
Subject: Get current date / time?
Message-Id: <3DF75D8F.E60E82B4@rogers.tv>
Dear readers,
Is it possible to get hold of the current date / time without having to
install a lot of CPAN modules? I have 5.8.1.
/// Jon R ///
------------------------------
Date: Wed, 11 Dec 2002 15:58:59 GMT
From: Kien Ha <kha2536@rogers.com>
Subject: Re: Get current date / time?
Message-Id: <3DF760DF.15B2871F@rogers.com>
Jon Rogers wrote:
>
> Dear readers,
>
> Is it possible to get hold of the current date / time without having to
> install a lot of CPAN modules? I have 5.8.1.
>
> /// Jon R ///
Yes. perldoc -f localtime.
perl -lwe 'print scalar localtime'
=> Wed Dec 11 10:58:25 2002
--
------------------------------
Date: 11 Dec 2002 16:46:45 +0100
From: mru@users.sourceforge.net (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
Subject: Re: Get current date / time?
Message-Id: <yw1xof7smuca.fsf@gladiusit.e.kth.se>
Jon Rogers <jon@rogers.tv> writes:
> Is it possible to get hold of the current date / time without having to
> install a lot of CPAN modules? I have 5.8.1.
time will give # of seconds since 1/1/1970, or whatever your epoch
is. Use localtime to break it down into year, month etc.
--
Måns Rullgård
mru@users.sf.net
------------------------------
Date: Wed, 11 Dec 2002 10:52:35 -0500
From: zentara <zentara@highstream.net>
Subject: Re: gtk-perl
Message-Id: <bknevus77ng1r0gj7a0dkqk0e4qq051k5u@4ax.com>
On Tue, 10 Dec 2002 17:37:21 GMT, Leo <stijn.gunst@pandora.be> wrote:
>hi,
>
>i have trouble getting gtk-perl installed
>this is what the error-output looks like (piece of output of make, see
>bottom)
>the linker tries to link the object-files, but i noticed the object file
>aren't in dir xs/ but one dir higher up
>i don't find people with same problem on Google, which is strange, as i'm
>only doing a standard install (perl Makefile.PL, make, make install)
>how can i have this module compiled and installed??
>gcc: xs/GtkMenuBar.o: No such file or directory
>gcc: xs/GtkCheckMenuItem.o: No such file or directory
>gcc: xs/Gtk-1.2.o: No such file or directory
When I first built it, I just copied all the .o files into the
respective xs directory. I found this patch later which
fixes it, it comes with the SuSE sources for Gtk-perl.
Put the patch in the fresh Gtk-perl directory and run
patch -p0<patchname
By the way, if you want a really cool image viewer for gtk-perl
go here and get the lib and module. When you build the module,
you will get the same error as above, just copy the .o file to where
it wants it, and run make again.
http://imagic.weizmann.ac.il/~dov/freesw/gtk/gtk-image-viewer/
Gtk-dif
###########################################################
--- Applet/Makefile.PL
+++ Applet/Makefile.PL
@@ -102,7 +102,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- Bonobo/Makefile.PL
+++ Bonobo/Makefile.PL
@@ -96,7 +96,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GdkImlib/Makefile.PL
+++ GdkImlib/Makefile.PL
@@ -43,6 +43,6 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GdkPixbuf/Makefile.PL
+++ GdkPixbuf/Makefile.PL
@@ -89,6 +89,6 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- Glade/Makefile.PL
+++ Glade/Makefile.PL
@@ -108,7 +108,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- Gnome/Makefile.PL
+++ Gnome/Makefile.PL
@@ -125,7 +125,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GnomePrint/Makefile.PL
+++ GnomePrint/Makefile.PL
@@ -112,7 +112,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- Gtk/Makefile.PL
+++ Gtk/Makefile.PL
@@ -190,7 +190,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GtkGLArea/Makefile.PL
+++ GtkGLArea/Makefile.PL
@@ -104,7 +104,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GtkHTML/Makefile.PL
+++ GtkHTML/Makefile.PL
@@ -107,7 +107,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- GtkXmHTML/Makefile.PL
+++ GtkXmHTML/Makefile.PL
@@ -95,7 +95,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
--- Mozilla/Makefile.PL
+++ Mozilla/Makefile.PL
@@ -94,7 +94,7 @@
sub MY::c_o {
package MY; # so that "SUPER" works right
my $inherited = shift->SUPER::c_o(@_);
- $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/m;
+ $inherited =~ s/CCCMD.*$/$&\n\t\@if test -f `basename \$*.o` -a
"`basename \$*.o`" != "\$*.o"; then mv `basename \$*.o` \$*.o; fi/mg;
$inherited;
}
#######################################################
------------------------------
Date: Wed, 11 Dec 2002 15:11:43 GMT
From: "codeWarrior" <GPatnude@adelphia.net>
Subject: Re: hidden eval variables
Message-Id: <PAIJ9.17018$VA5.1511467@news1.news.adelphia.net>
"Risto Vaarandi" <risto.vaarandi@eyp.ee> wrote in message
news:3DF62500.B4EE12B2@eyp.ee...
> hi,
>
> I would like to build an expression calculator that would read user
> input from stdin and rely on perl's eval() to calculate the expression
> the user entered.
> However, with eval() the user can actually set variables inside the
> program if he/she wants to. E.g., if user enters $a = 1 and there is a
> variable called $a in the main perl program, the value of that variable
> will be changed.
> Is there any way to avoid that? (with eval() or some other way?)
>
> br,
> risto
Danger Will Robinson....
What if the user input contains something like: "system rm *" and then you
eval {system rm *}; # ???
Don't you think you are opening up a can of worms ???
------------------------------
Date: 11 Dec 2002 15:30:56 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: hidden eval variables
Message-Id: <at7lng$co2$2@mamenchi.zrz.TU-Berlin.DE>
According to Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de>:
> Also sprach Anno Siegel:
>
> > According to Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de>:
> >> Also sprach Anno Siegel:
> >>
> >> > According to Tassilo v. Parseval <tassilo.parseval@post.rwth-aachen.de>:
> >>
> >> >> use strict;
> >> >> {
> >> >> # ordinary script
> >> >> ...
> >> >> call_eval();
> >> >> }
> >> >> sub call_eval {
> >> >> eval <STDIN>;
> >> >> }
> >> >>
> >> >> Thus you can protect all lexical variables from the upper block. They
> >> >> will be invisible within call_eval() as long as they are declared with
> >> >> my().
> >> >
> >> > ...except for possible file-global lexicals that happen to be declared
> >> > before the "sub call_eval ..." statement, so this sub should be one of
> >> > the first things in the file. The peculiar placement deserves a comment.
> >>
> >> Good point. I was aware of the problem with declared globals but had no
> >> real solution for that so I left that off (hoping that 'use vars' and
> >> possibly our() wouldn't be that common anyway). The re-placement of the
> >> subroutine is an obvious solution that escaped me.
> >
> > Ah, but this isn't about "use vars" and "our()". Package variables
> > will always be accessible from anywhere, only lexicals can be protected.
>
> Oh, sorry, missed the bits about "lexicals" that are file-global. I
> think they don't exist in my solution since the whole program (except for
> the call_eval() subroutine) is meant to reside in a block of its own. In
> such a case it is does not matter where call_eval() is declared...all
> lexicals from the program are invisible to it.
Oh... now there is something *I* overlooked. Yes, if you put all
the rest of the program in a block of its own you should be safe,
lexical-wise.
Anno
------------------------------
Date: Wed, 11 Dec 2002 15:58:04 +0000
From: Simon Oliver <simon.oliver@nospam.umist.ac.uk>
Subject: Re: How does HTML encodes GET and POST requests?
Message-Id: <3DF7608C.4020606@nospam.umist.ac.uk>
gnuist006 wrote:
> jstokes@crmnet.org (John Stokes) wrote in message news:
>
> I do not know if this is the right group for my question sorry if I am
> wrong here.
>
> I have the following html page:
>
> <html><head></head>
>
> <form method=post action=http://www.some_site.zzz/tt.t >
> <input type="text" name="ID" value="5">
> <INPUT type="submit" name="down_load" VALUE="button">
> </form>
>
> </body></html>
>
> and when I click the button the site sends a file and a dialog box opens
> with the filename in it asking your to save it.
>
> I want to automate this. One method is to construct some url like this:
>
> http://www.some_site.zzz/tt.t-ID=5&down_load=submit&method=post
>
> I am not sure if this is correct approach. I know little about wget although
> it comes with NTRK and I know little about perl. If a kind soul can give me
> a very simple working solution in either wget, perl or both, it would be
> very nice. I know C/C++ and can hack a little if you get me started.
You need to constuct the appropriate http request headers and post data.
LWP is your friend here. Look at LWP::UserAgent and the $ua->post method.
Here's a little example:
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
my $ua = LWP::UserAgent->new;
my $url = 'http://domain.net/cgi-bin/sample.cgi';
my $form = {
ID => 5,
};
my $response = $ua->request(POST $url, $form);
print $response->is_success ?
$response->content :
$response->error_as_HTML;
--
Simon Oliver
------------------------------
Date: Wed, 11 Dec 2002 15:52:06 GMT
From: "Ron Ruble" <raffles2@att.net>
Subject: Re: Max fork'd proc limit...?
Message-Id: <GaJJ9.48153$vM1.3876015@bgtnsc04-news.ops.worldnet.att.net>
"Walter Roberson" <roberson@ibd.nrc.ca> wrote in message
news:at3m6e$oje$1@canopus.cc.umanitoba.ca...
<snip>
> I believe I've read in this newsgroup
> that Windows does not have
> a unix-style fork that produces a
> new process, and that on Windows
> fork is implimented using threads.
> 64 sounds like a plausible
> "magic number" as to how many
> threads might be allowed by Windows.
Yes and no. Windows can start quite a large
number of threads; but there is a per-process
limit in pre-Win2K versions of Windows on
thread-local-storage (TLS) entries.
It isn't necessary to allocate a TLS-entry
per thread, but VC and a few other C
compilers do so by default, resulting in
an artificial 64-thread limit.
If this is the case, the code that performs
the fork() for the Perl interpreter would
need to be recompiled (and possibly
modified to use TLS entries more
sparingly).
------------------------------
Date: Wed, 11 Dec 2002 14:04:23 GMT
From: "TBN" <ihave@noemail.com>
Subject: Re: Newbie question
Message-Id: <GBHJ9.172$dwA4.20447366@news2.randori.com>
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3df6ceca.27824714@news.erols.com...
> "TBN" <ihave@noemail.com> wrote:
>
> : Subject: Newbie question
>
> You cannot be so new that you do not recognize the value of a good subject
> line, and that the one you chose there is worthless.
>
I'll try to do better, but I did get a good answer so it couldn't have been
completely worthless.
------------------------------
Date: Wed, 11 Dec 2002 15:50:10 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Passing an object to another object
Message-Id: <at7mk8$7s6$1@news.dtag.de>
Dela Lovecraft wrote:
> sub new
> {
> my $type = shift;
> my $class = ref($type) || $type;
> my $self = {};
> my $tempObject = shift;
That's right. Maybe tempObject is a bad name, but if it fits your mind
thats ok.
> $self->{OBJECT} = $tempObject;
> $self->{WHO} = $tempObject->{NAME}; #Or use a function:
You should use a method. _NEVER_ access the underlying structure of a
foreign object directly. Whether, you should ever access your own
structure outside of accessor methods is a different matter.
> # $self->{WHO} = $tempObject->getName();
We don't know tempObject's type. Perl is not Java/C#/strictly typed. You
have to tell us. Does getName() exist and does it return a defined value?
Bye,
->malte
--
srand 108641088; print chr int rand 256 for qw<J A P H>
------------------------------
Date: 11 Dec 2002 14:57:22 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Passing an object to another object
Message-Id: <at7joi$jng$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Dela Lovecraft:
> 'Nother question. :)
>
> I have an object into which I need to pass another, different object in
> the following manner:
>
> Object::Object2->new($instanceOfObject1);
>
> Assume that Object1 has a new() sub similar to:
>
> sub new
> {
> my $type = shift;
> my $class = ref($type) || $type;
> my $self = {};
>
> $self->{NAME} = shift;
> $self->{HONORIFIC} = shift;
> bless ($self, $class);
> return $self;
> }
>
> So to make a new instance we can use the following construct:
>
> my $o = Object::Object1->new("Jones", "Mrs");
>
> No problem. If I want to pass this object as the arguments to another
> object's creation, how would I do it? If I use this:
>
> sub new
> {
> my $type = shift;
> my $class = ref($type) || $type;
> my $self = {};
> my $tempObject = shift;
> $self->{OBJECT} = $tempObject;
> $self->{WHO} = $tempObject->{NAME}; #Or use a function:
> # $self->{WHO} = $tempObject->getName();
> bless ($self, $class);
> return $self;
> }
>
> # Usage: Object::Object2->new($o);
>
>
> Then it all goes a bit wrong, and $self->{WHO} is undefined.
I don't see how this should happen. You do it exactly how it should be
done in my eyes (unless I missed an obvious mistake in your code).
> I need to use objects on this, but I am at the early stages of learning.
> I have a feeling it has something to do with passing the object as a
> scalar, but that is as far as my tiny brain has got.
All you have to do is passing the scalar that holds the object. But
remember that this scalar is a reference to this blessed thing. So when
you pass Object1 to Object2 and later change the Object1 these changes
will also take place to the object that you stored in Object2. But even
this should not have happened because you store a copy of the string in
$obj1->{NAME} in the WHO-slot of Object2.
I'd recommend to have a look at the internals of the second object once
created:
use Data::Dumper;
...
my $obj2 = Object::Object2->new($obj1);
print Dumper $obj2;
If you don't find the structure of $obj1 in it something obviously went
wrong.
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: 11 Dec 2002 07:27:28 -0800
From: stas@epost.de (Stas Neuberger)
Subject: Re: perl bad interpreter: No such file or directory
Message-Id: <bea0b7d7.0212110727.7f771723@posting.google.com>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message news:<Pine.LNX.4.40.0212111112280.21307-100000@lxplus072.cern.ch>...
> On Dec 11, Eric Le Donné deposited TOFU on the eternal scroll:
>
> > ... or #!/usr/bin/perl ain't a valid Perl interpreter...
>
> It seems to be a constant of nature that top-posters never take the
> time to understand what they're quoting.
>
> > since perl script.pl works, it's quite likely that it doesn't reside under
> > /usr/bin
>
> Which would make it more than a little implausible why the original
> poster reported that merely adding -w to the shebang line would
> miraculously repair the problem.
>
> > What does "which perl" return ?
>
> It's quite conceivable that "which perl" would report
> /usr/local/bin/perl _despite_ the fact that a shebang line of
> #!/usr/bin/perl works correctly. Witness one particular system (yes,
> it happens to be an old one) where this is the case:
>
> ls -l /usr/bin/perl
> lrwxr-xr-x 1 root system 19 Feb 20 1999 /usr/bin/perl ->
> /usr/local/bin/perl
>
> As I said, the symptoms are very characteristic. There's a stray
> control character at the end of the shebang line, and my hunch is that
> the original poster was mistaken in thinking it was a "normal unix
> LF". Perhaps I'll be proved wrong in thinking that the offending
> character is a CR, but it seems a reasonable initial hypothesis.
>
>
> [fullquote snipped, and considering adding @spam to the @nospam
> that's already in the scorefile.]
which perl returns /usr/local/bin/perl. changing the shebang line to
it produces the same error.
ls -l /usr/bin/perl returns following
-rwxr-xr-x 2 root root 775822 May 11 2001 /usr/bin/perl
the line feeds are unix style. i don't think vi would make it dos like
thx
------------------------------
Date: Wed, 11 Dec 2002 08:56:39 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: scorefile/killfile (was Re: Comparison confusion)
Message-Id: <slrnavekh7.62b.tadmc@magna.augustmail.com>
Andras Malatinszky <nobody@dev.null> wrote:
> Tad McClellan wrote:
>>
>> The scorefile will work properly after I start a new newsreader session.
>>
> What is this scorefile thing you keep mentioning?
^^^^^^^^^^^^^^^
(that is just the tip of the iceberg. Only about 1 of 10 scorefile
entries are mentioned publically. Most are just done silently.
)
A scorefile is a newsreader feature that automatically filters
Usenet postings, similar to spam-filtering for email.
It is an improvement over a killfile (invented by Larry Wall!):
http://www.tuxedo.org/~esr/jargon/html/entry/kill-file.html
A killfile is a binary decision. It either automatically deletes
an article so that the reader never even sees it, or it passes
it through.
A scorefile assigns "scores" to articles, some positive, some negative.
You can then apply a threshhold score that determines whether the
article is to be read or ignored.
There are way too many posts here each day. I cannot read them all.
I've developed a scorefile that identifies articles that I might
want to read, as well as articles that I do not want to read.
Some scoring rules are heuristics (rules of thumb) that apply
to all articles:
For example:
% red flag subjects
Score:: -5000
Subject: newbie
Subject: \?\?\?
% interesting subjects
Score:: 9000
Subject: beginner
Others are specific to individuals:
% trolls
Score:: -9998
From: <posting address deleted to protect the guilty>
I very seldom have time to read articles scored below -2000.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 11 Dec 2002 16:12:51 +0100
From: rootmj <rootmj@seznam.cz>
Subject: Re: which UI for Perl?
Message-Id: <at7kkn$f1f$1@news.vutbr.cz>
Some good GUI is wxPerl:
http://wxperl.sourceforge.net/
http://wxperl.pvoice.org/
http://www.wxwindows.org/
Erik Braun wrote:
> I'm looking for a Perl Module, which provides interactive dialogs,
> and some extensions like Radio buttons or file requestors.
>
> I found some Modules (Dialog, Perlmenu, Cdk, Curses), but did not test
> everything, as this is a lot of work. Is someone around here, who
> had the same problem and can me recommend or discourage from one
> of these?
>
> erik
--
------------------------------
S pozdravem Michal Jurosz
rootmj@seznam.cz ICQ#:93348414
http://mjhome.zde.cz
------------------------------
------------------------------
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 4248
***************************************