[15630] in Perl-Users-Digest
Perl-Users Digest, Issue: 3043 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 14 18:08:41 2000
Date: Sun, 14 May 2000 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <958341910-v9-i3043@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 14 May 2000 Volume: 9 Number: 3043
Today's topics:
Re:   - what is it? <iltzu@sci.invalid>
Re:   - what is it? <flavell@mail.cern.ch>
_PATH_LOG not defined <sumengen@hotelspectra.com>
Access from several Perl-Scripts on one variable? <thorsten_kuske@gmx.net>
Re: Access from several Perl-Scripts on one variable? <tony_curtis32@yahoo.com>
Re: can scalars evaluate as operators? <iltzu@sci.invalid>
creating a complex HoH (Eric Smith)
Re: Execute permissions of a directory <sentwisle@ozemail.com.au>
file confusing <danielxx@bart.nl>
files <danielxx@bart.nl>
Forms with Perl <duxbury@kentmere23.freeserve.co.uk>
Re: Forms with Perl <flavell@mail.cern.ch>
Re: Forms with Perl <duxbury@kentmere23.freeserve.co.uk>
Re: Forms with Perl <tony_curtis32@yahoo.com>
Re: How do I get a user's home directory with NIS+? (Willi Burmeister)
How to COPY a website <ksmith@firesnacks.com>
Re: Location of Dictionaries, Encyclopadias and public <andy@u2me3.com>
Re: Newbie on Perl/CGI, which editor is the best on NT? <nnickee@nnickee.com>
Re: Newbie on Perl/CGI, which editor is the best on NT? <cure@texas.net>
Re: Newbie on Perl/CGI, which editor is the best on NT? (Monte Phillips)
Re: Newbie on Perl/CGI, which editor is the best on NT? <andy@u2me3.com>
Re: Newbie on Perl/CGI, which editor is the best on NT? <andy@u2me3.com>
Re: newbie question / extract records between patterns (Tad McClellan)
Re: Reading/searching file problem (Tad McClellan)
Re: sorry repost i need help despertly can someone just <gellyfish@gellyfish.com>
Re: sorry repost i need help despertly can someone just <iltzu@sci.invalid>
Re: spoofing identity <andy@u2me3.com>
Re: tie 'MLDBM' from a CGI script not working -- any cl vuulza@my-deja.com
using an array from the disk <sumengen@hotelspectra.com>
Re: Using user-variables in external commands? <epa98@doc.ic.ac.uk>
Re: Using user-variables in external commands? <iltzu@sci.invalid>
Re: where can i find perl? <anmcguire@ce.mediaone.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 May 2000 19:00:48 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re:   - what is it?
Message-Id: <958330592.21690@itz.pp.sci.fi>
In article <8fjbcr$860$1@orpheus.gellyfish.com>, Jonathan Stowe wrote:
>On Fri, 12 May 2000 16:20:07 -0700 Larry Rosler wrote:
>> In article
>> <15F82521AF5D18AC.ECEC2093AACED09A.D67F8BB484DE18E5@lp.airnews.net> on
>> Fri, 12 May 2000 17:24:22 -0500, Paul Phillips <paul@partitura.com>
>> says...
>>>
>>>  
>>
>> That isn't Perl. It is incorrect HTML.
>
>sub nbsp
>{
> return ' '
>}
>perhaps ;-?
Surely you mean: sub nbsp { "\240" }
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Sun, 14 May 2000 22:29:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re:   - what is it?
Message-Id: <Pine.GHP.4.21.0005142218530.397-100000@hpplus01.cern.ch>
On 14 May 2000, Ilmari Karonen wrote:
> Surely you mean: sub nbsp { "\240" }
But that depends on what character coding you are using.
For example in koi8-r the nobreak space is at a different
code point than it is in the iso-8859-* codings.
In HTML it's still correctly represented as or   or À
, but as a coded octet it's (shuffle, shuffle) \232 if I'm not
mistaken (x9a, decimal 154).
Sorry, could not resist. http://koi8.pp.ru/font.html
------------------------------
Date: Sun, 14 May 2000 11:54:24 -0700
From: "Baris" <sumengen@hotelspectra.com>
Subject: _PATH_LOG not defined
Message-Id: <391ef5c1$1_1@goliath2.newsfeeds.com>
I was trying to install DBI on SGI Irix 5.3, and I received an error message
saying something like this:
_PATH_LOG is not defined; error in line 277 in Sys/Syslog.pm
If I look at the header file Sys/Syslog.h , I saw that _PATH_LOG is not
defined in it, on the other hand on my linux machine, it is defined in
Syslog.h.
I checked other SGI machines running Irix 6.4 and find out that they have
the same problem.
How can I solve this problem?
Baris.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 14 May 2000 16:52:29 -0500
From: "Thorsten" <thorsten_kuske@gmx.net>
Subject: Access from several Perl-Scripts on one variable?
Message-Id: <01be9e53$54e94340$e1be06d5@unbekanb>
Is it possible to access from several Perl-Scripts on one variable?
I would be really glad if you could answer me that question and how to do
so, because this would mean to me to save several hours of work.
Thank you very much!
------------------------------
Date: Sun, 14 May 2000 21:57:52 GMT
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Access from several Perl-Scripts on one variable?
Message-Id: <87d7molrq7.fsf@shleppie.uh.edu>
>> On 14 May 2000 16:52:29 -0500,
>> "Thorsten" <thorsten_kuske@gmx.net> said:
> Is it possible to access from several Perl-Scripts on
> one variable? I would be really glad if you could
> answer me that question and how to do so, because this
> would mean to me to save several hours of work.
I appreciate that English might not be your first language
(German? I lived in Austria so I can empathise with doing
things in a 2nd language).
It's not clear from your question exactly what you want to
do. Could you give an example of what you're trying to
do? There might also be a better way of achieving what
you want.
I interpret the question to mean:
can I share configuration variables between
multiple programs from a common location?
but I'm not sure that's exactly what you mean.
hth
t
------------------------------
Date: 14 May 2000 20:43:53 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: can scalars evaluate as operators?
Message-Id: <958332883.23734@itz.pp.sci.fi>
In article <slrn8houq1.bgd.abigail@ucan.foad.org>, Abigail wrote:
>On Fri, 12 May 2000 15:33:16 -0500, Tom Briles <sariq@texas.net> wrote:
>++ I suspect that Abigail already knows why many people consider 'eval
>++ EXPR' to be evil (or at least dangerous). But for anyone who doesn't
>++ know, I quote Tom Phoenix from 05 Nov 1999:
[snip]
>++ "When you eval a string, you are running code which isn't known until
>++ runtime. This is against all principles of structured programming. It
>++ can lead to programs which are difficult to debug. It can leak memory or
>++ even (in very rare cases) crash your program. Avoid, avoid, avoid.
>
>So, noone should be sending SQL queries as strings to a database server,
>but use stored procedures that have been compiled in advance?
I'd just like to throw in my two cents here by answering the preceding
rhetorical question with a firm and resounding "Yes!" - though I would
haste to point out that the implementation details (strings vs. stored
procedures) are less important than the exposed interface.
I develop database-driven web applications for work, and much - if not
most - of the efforts towards keeping the programs clean, reliable and
maintainable is spent in constructing extensive intermediate layers to
hide the SQL and wrap it in well tested and reviewed integrity checks.
Either that, or even more effort is eventually spent hunting down bugs
in the mess of dynamic SQL strings that is their natural habitat.
In Perl, DBI internally preprocesses statements in an attempt to avoid
the need for explicitly interpolating variables into SQL. This is not
much of an improvement, but I count it as a blessing - all too often I
have been tempted to resort to physical violence when somebody forgets
to correctly escape SQL metacharacters before interpolation.
In my not particularly humble opinion, constructing SQL as strings and
passing it from your code to a database server is just as ridiculously
contorted as cobbling together Perl code as strings in a shell script,
and evaluating it by calling perl -e. The fact that such practice has
become so ubiquitous only indicates that no better alternative has yet
gained sufficiently universal acceptance.
SQL is a reasonably useful, if specialized, script language in its own
right, some flavors more so than others. While embedding sublanguages
in other languages can be an extremely effective tool, they also cause
great potential for syntactic confusion, even where the languages have
been designed to be compatible and syntactically orthogonal, like with
C and its preprocessor or regexps in Perl. While SQL does go to great
lengths to use only plain words and minimal punctuation, thus managing
to avoid most metacharacters of other languages and many other similar
problems, the fact remains that manipulating structured code - whether
SQL or Perl - as unstructured strings is just asking for subtle bugs.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 14 May 2000 21:07:56 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: creating a complex HoH
Message-Id: <slrn8hu5cv.541.eric@plum.fruitcom.com>
I have input like (simplified):
record 1,567,444,granny,groupone
record 2,568,444,granny,groupone
and am able to obtain a simple multi-dime hash
by the following:
$bundle={ 'iteratorbundle' => { 'variety' => 'granny', 'count' => 444, \
'ID' => { 567 => 1} } } ;
so
print Dumper(\$bundle);
gives:
$VAR1 = \{
'iteratorbundle' => {
'count' => 444,
'variety' => 'granny',
'ID' => {
567 => 1
}
}
};
A shortish question would be, how do I obtain this:
$VAR1 = \{
'iteratorbundle' => {
'count' => 444,
'variety' => 'granny',
'ID' => {
567 => 1,
568 => 1
}
}
};
from passing through record number 2 above.
I am using a reference to a hash in $bundle but only becuase I believe that
may be more efficient. A plain %hash would be fine.
A longer question (possibly) would be how to create the following structure
while looping though input. I am used to creating HoH structures where
the HoH at each level has only a single key but cannot figure how to build
this type of stucture withmultiple keys in certain places. Tried perldsc and
perllol but am out of my depth :( . Finding I could achieve the above gave
me the confidence to build a looping routine for the structure below, only
to realise that creating the structure itself is not so straight forward
(to be anyway).
$VAR1 = {
'INTAKE 345345' => {
'Joe Bloggs' => {
'AHG3453' => {
'BUNDLE' => {
'group1' => {
'Weight' => '18.25',
'size' => 88,
'Picking Date' => '22/07/99',
'Variety' => 'Granny',
'ID' => {
3778 => 1,
539 => 1,
545 => 1,
546 => 1
},
'Brand' => 'Whatever'
},
'group2' => {
'Weight' => '4.5',
'size' => 'L',
'Picking Date' => '22/04/99',
'Variety' => 'Red',
'Brand' => 'Blue'
}
},
'AMOUNT' => {
'S,Sale' => {
'FIN,Final Sale' => '466.37',
'COM,Commission,10' => {
'FRF,French Francs' => {
'Level' => 'P',
'Currency' => 'CNY',
'Whatever' => 'something',
'Actual Amount' => '452.65'
}
}
},
'Payment' => {
'first' => '145.87',
'third' => '634.29',
'second' => '34.32'
}
}
}
}
}
};
--
Eric Smith
eric@fruitcom.com
------------------------------
Date: Mon, 15 May 2000 06:56:35 +1000
From: "Susan Entwisle" <sentwisle@ozemail.com.au>
Subject: Re: Execute permissions of a directory
Message-Id: <qlET4.28861$PL4.589982@ozemail.com.au>
Thanks Larry, I will give it another go.
Cheers
Susan Entwisle
"Larry Rosler" <lr@hpl.hp.com> wrote in message
news:MPG.1387ef4f42f05ea898aa79@nntp.hpl.hp.com...
> In article <UEpT4.28400$PL4.565919@ozemail.com.au> on Sun, 14 May 2000
> 14:13:19 +1000, Susan Entwisle <sentwisle@ozemail.com.au> says...
>
> ...
>
> > I have tried using the following code but it does not work:
>
> It doesn't even compile properly.
>
> > $matchcount=grep(/'/'/, $ARGV[0]);
>
> You are trying to determine whether there is a slash in the string
> $ARGV[0], using a regex. That regex is invalid. These are valid:
>
> /\//
>
> or, better (using a delimiter of your choice):
>
> m!/!
>
> In addition, grep() isn't the best tool, because it is designed to
> select or count matching elements from a list, not a single scalar. You
> can use a pattern match:
>
> $matchcount = $ARGV[0] =~ m!/!;
>
> or (better) the index() function:
>
> $matchcount = index($ARGV[0], '/') >= 0;
>
> > if ($matchcount)
>
> As you don't use this variable elsewhere, you could simply write the
> predicate expression between the parentheses, instead of storing the
> result and testing it.
>
> > {
> > @sections=split(/'/'/, $ARGV[0]);
>
> Wrong regex again. See above.
>
> > foreach $currsection(@sections)
>
> But I can't imagine why you are looping over the results of the split()
> when you don't use the section in the loop, which is the same each time
> through.
>
> > {
> > if (-d $ARGV[0])
> > {
> > if (-X $ARGV[0])
> > {
> > print "Directory with execute persmissions";
> > }
> > else
> > {
> > print "Directory does not have execute permissions";
> > exit(1);
> > }
> > }
> > else
> > {
> > print "Regular expression with / in it";
> > last;
> > }
> > }
> > }
> > else
> > {
> > print "Normal Regular expression";
> > }
>
> Clean up the code until it compiles properly, and think through the
> logic more clearly.
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Sun, 14 May 2000 21:50:43 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: file confusing
Message-Id: <TcFT4.1642$Kk2.17720@Typhoon.bART.nl>
This is a multi-part message in MIME format.
------=_NextPart_000_0040_01BFBDFF.3C22FFA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Doing this causes only the parent directory and directory above to get a =
right time and size index wh wh whyyy ???
#!c:\perl\bin
$namev =3D "Inetpub";
$curdir =3D "c:/";
opendir DH, "$curdir/$namev" or die "Can't open: $!";
while ($namev =3D readdir(DH)) {
$time1 =3D (stat($namev))[9];
$time2 =3D scalar localtime($time1);
$size =3D (stat($namev))[7];
print "\n$namev $time2 $size";
}
closedir(DH);
Daniel van den Oord ( Daniel304 RTCL )
-------------------------------------------------------------------------=
-------
It's nice to be important, but it's more important to be nice
See there be good bye bye
-------------------------------------------------------------------------=
-------
Daniel304rt ResearchTriangle Community Leader
http://www.geocities.com/ResearchTriangle/Forum/5577=20
------=_NextPart_000_0040_01BFBDFF.3C22FFA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3013.2600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Doing this causes only the parent =
directory and=20
directory above to get a right time and size index wh wh whyyy =
???</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>#!c:\perl\bin</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>$namev =3D "Inetpub";<BR>$curdir =3D=20
"c:/";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>opendir DH, "$curdir/$namev" or =
die "Can't=20
open: $!";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>while ($namev =3D readdir(DH)) =
{<BR>$time1 =3D=20
(stat($namev))[9];<BR>$time2 =3D scalar =
localtime($time1);<BR>$size =3D=20
(stat($namev))[7];<BR>print "\n$namev $time2=20
$size";<BR>}<BR>closedir(DH);</FONT></DIV>
<DIV>
<P>Daniel van den Oord ( Daniel304 RTCL =
)</P>
<HR>
It's nice to be important, but it's more important to be nice<BR>See =
there be=20
good bye bye
<HR>
Daniel304rt ResearchTriangle Community Leader<BR><A=20
href=3D"http://www.geocities.com/ResearchTriangle/Forum/5577">http://www.=
geocities.com/ResearchTriangle/Forum/5577</A>=20
</DIV></BODY></HTML>
------=_NextPart_000_0040_01BFBDFF.3C22FFA0--
------------------------------
Date: Sun, 14 May 2000 20:06:55 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: files
Message-Id: <zHDT4.1631$Kk2.17523@Typhoon.bART.nl>
This is a multi-part message in MIME format.
------=_NextPart_000_002B_01BFBDF0.BBCAE420
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there some easy way of getting filesize / filetype and those things =
???
Daniel van den Oord ( Daniel304 RTCL )
-------------------------------------------------------------------------=
-------
It's nice to be important, but it's more important to be nice
See there be good bye bye
-------------------------------------------------------------------------=
-------
Daniel304rt ResearchTriangle Community Leader
http://www.geocities.com/ResearchTriangle/Forum/5577=20
------=_NextPart_000_002B_01BFBDF0.BBCAE420
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3013.2600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Is there some easy way of getting =
filesize /=20
filetype and those things ???</FONT></DIV>
<DIV>
<P>Daniel van den Oord ( Daniel304 RTCL =
)</P>
<HR>
It's nice to be important, but it's more important to be nice<BR>See =
there be=20
good bye bye
<HR>
Daniel304rt ResearchTriangle Community Leader<BR><A=20
href=3D"http://www.geocities.com/ResearchTriangle/Forum/5577">http://www.=
geocities.com/ResearchTriangle/Forum/5577</A>=20
</DIV></BODY></HTML>
------=_NextPart_000_002B_01BFBDF0.BBCAE420--
------------------------------
Date: Sun, 14 May 2000 21:44:25 +0100
From: "Ian" <duxbury@kentmere23.freeserve.co.uk>
Subject: Forms with Perl
Message-Id: <8fn367$khd$1@newsg3.svr.pol.co.uk>
When I try to run this script on my windows ActivePerl I get this prompt "
(offline mode: enter name=value pairs on standard input)". Can anyone tell
me what it means, I just trying to learn how to send data to forms.Thanks.
#!/usr/local/bin/perl
use CGI qw(:standard);
print header;
print start_html('A Simple Example'),
h1('A Simple Example'),
start_form,
"What's your name? ",textfield('name'),
p,
"What's the combination?",
p,
checkbox_group(-name=>'words',
-values=>['eenie','meenie','minie','moe'],
-defaults=>['eenie','minie']),
p,
"What's your favorite color? ",
popup_menu(-name=>'color',
-values=>['red','green','blue','chartreuse']),
p,
submit,
end_form,
hr;
if (param()) {
print
"Your name is",em(param('name')),
p,
"The keywords are: ",em(join(", ",param('words'))),
p,
"Your favorite color is ",em(param('color')),
hr;
}
print end_html;
------------------------------
Date: Sun, 14 May 2000 23:00:07 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Forms with Perl
Message-Id: <Pine.GHP.4.21.0005142256010.397-100000@hpplus01.cern.ch>
On Sun, 14 May 2000, Ian wrote:
> When I try to run this script on my windows ActivePerl I get this prompt "
> (offline mode: enter name=value pairs on standard input)". Can anyone tell
> me what it means,
It means you've missed the relevant part of the CGI.pm documentation
;-)
It's explained in the section headed "Debugging".
> I just trying to learn how to send data to forms.
You're doing fine so far, but please pay attention to the
repeated-at-least-thrice-daily advice here to make use of all the help
that Perl can give you. That means using -w (and -T when relevant,
which in CGI scripts it usually is), and "use strict;".
It's a pity that L.Stein's published examples don't do this.
------------------------------
Date: Sun, 14 May 2000 22:41:18 +0100
From: "Ian" <duxbury@kentmere23.freeserve.co.uk>
Subject: Re: Forms with Perl
Message-Id: <8fn6j7$oku$1@news5.svr.pol.co.uk>
This debugging seems really complicated. Is there no easy way around. I
copied the code from a website so you may have got the impression that I
know more than I actually do.
I skimmed through the pages of debugging but I can't seem to find anything
relating to (offline mode: enter name=value pairs on standard input) what
ever this is. Any more suggestions. Cheers.
Alan J. Flavell <flavell@mail.cern.ch> wrote in message
news:Pine.GHP.4.21.0005142256010.397-100000@hpplus01.cern.ch...
> On Sun, 14 May 2000, Ian wrote:
>
> > When I try to run this script on my windows ActivePerl I get this prompt
"
> > (offline mode: enter name=value pairs on standard input)". Can anyone
tell
> > me what it means,
>
> It means you've missed the relevant part of the CGI.pm documentation
> ;-)
>
> It's explained in the section headed "Debugging".
>
> > I just trying to learn how to send data to forms.
>
> You're doing fine so far, but please pay attention to the
> repeated-at-least-thrice-daily advice here to make use of all the help
> that Perl can give you. That means using -w (and -T when relevant,
> which in CGI scripts it usually is), and "use strict;".
>
> It's a pity that L.Stein's published examples don't do this.
>
------------------------------
Date: Sun, 14 May 2000 21:53:15 GMT
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Forms with Perl
Message-Id: <87g0rklrxw.fsf@shleppie.uh.edu>
[ please add your new text *after* the stuff
you're replying to, otherwise it's nigh on impossible to
follow what's going on ]
>> On Sun, 14 May 2000 22:41:18 +0100,
>> "Ian" <duxbury@kentmere23.freeserve.co.uk> said:
> This debugging seems really complicated. Is there no
> easy way around. I copied the code from a website so you
> may have got the impression that I know more than I
> actually do.
> I skimmed through the pages of debugging but I can't
> seem to find anything relating to (offline mode: enter
> name=value pairs on standard input) what ever this
> is.
perldoc CGI <RET> /DEBUG <RET>
or
http://stein.cshl.org/WWW/CGI/#debugging
if you want to read it on the web.
how difficult can it be? :-)
hth
t
------------------------------
Date: 14 May 2000 18:21:45 GMT
From: wib+usenet@cs.uni-kiel.de (Willi Burmeister)
Subject: Re: How do I get a user's home directory with NIS+?
Message-Id: <8fmqrp$kge$1@bossix.informatik.uni-kiel.de>
In <dgishs4iln27ithtjeqiokhvduhf2uds01@4ax.com> Scott Houck <shouck@bellatlantic.net> writes:
>$user = `whoami`;
>$nisinfo = `niscat passwd.org_dir | grep $user`;
>$home_dir = (split /:/, $nisinfo)[5];
>Is there a better way to do this?
$nisinfo = `nismatch $user passwd.org_dir`;
Willi
------------------------------
Date: Sun, 14 May 2000 21:58:58 GMT
From: "Keith Smith" <ksmith@firesnacks.com>
Subject: How to COPY a website
Message-Id: <CkFT4.5349$f12.123160@news1.rdc1.on.wave.home.com>
Hi folks:
Are there any good scripts out there for retrieving all the files found at a
website? Essentially, I would like to point this tool at a URL and have it
decend all the local links and retrieve all the content associated with
static html links.
Thoughts/coments?
Keith
------------------------------
Date: Sun, 14 May 2000 17:12:13 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: Location of Dictionaries, Encyclopadias and public domain books in ASCII format on line?
Message-Id: <8fmj9a$3mv$1@neptunium.btinternet.com>
Yeah, try Yahoo.com.
------------------------------
Date: Sun, 14 May 2000 15:45:28 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: Newbie on Perl/CGI, which editor is the best on NT?
Message-Id: <D09287AC62E32684.C605C73A79F0C999.EA871DA50E0B4D7C@lp.airnews.net>
On Sun, 14 May 2000 17:54:11 +0200, someone claiming to be "Ganix"
<ganix#gmx.net> said:
>"Cantonese Boy" <cantnoeseboy@netscape.net> schrieb im Newsbeitrag
>news:391EA66E.E9F59EF9@netscape.net...
>> I have tried visual perl, but it is not a shareware.
>> Which perl/CGI editor is better?
>I use Ultraedit for all kind of editing. It provides
>syntaxhighlighting for all kind of languages
>and regular expression search and replace.
>http://www.ultraedit.com
I like arachnophilia -
http://www.arachnoid.com/arachnophilia/index.html (no affiliation)
It's careware (it's not about $$, you just have to care) - it has a
"beautify code" function that pretties up indents and tells you if you
have unmatching { } or ( )'s - you can have multiple files open in the
same instance of the program - can search/replace over all open files
or just the active file or over a selected bit of the active file -
and my favorite thing in arach is being able to add my own toolbars
and buttons of the code bits that I use most often.
Nnickee
------------------------------
Date: Sun, 14 May 2000 16:06:51 -0700
From: Cure <cure@texas.net>
Subject: Re: Newbie on Perl/CGI, which editor is the best on NT?
Message-Id: <391F318B.A566E700@texas.net>
Editplus is the best editor for win32 platform
www.editplus.com
Cantonese Boy wrote:
> I have tried visual perl, but it is not a shareware.
> Which perl/CGI editor is better?
>
> W
------------------------------
Date: Sun, 14 May 2000 20:51:01 GMT
From: montep@hal-pc.org (Monte Phillips)
Subject: Re: Newbie on Perl/CGI, which editor is the best on NT?
Message-Id: <391f1163.29431090@news.hal-pc.org>
On Sun, 14 May 2000 21:13:18 +0800, Cantonese Boy
<cantnoeseboy@netscape.net> wrote:
>I have tried visual perl, but it is not a shareware.
>Which perl/CGI editor is better?
>
>W
Far and away the best perl editor on a windows machine is DZSofts
DZPerl. It not only has all the edit functions but will run and
display your code. Look up DZSoft on the web
------------------------------
Date: Sun, 14 May 2000 17:13:35 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: Newbie on Perl/CGI, which editor is the best on NT?
Message-Id: <8fmjd9$ljg$1@uranium.btinternet.com>
Notepad :o)
Thanks, Andy.
andy@u2me3.com
------------------------------
Date: Sun, 14 May 2000 17:15:02 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: Newbie on Perl/CGI, which editor is the best on NT?
Message-Id: <8fmjd9$ljg$2@uranium.btinternet.com>
Hehe, sorry for two posts ... but seriously, I like CodeWhiz
(http://www.codewhiz.com) whenever I'm writing in Windoze ... as it supports
multiple languages, including Perl.
Thanks, Andy.
andy@u2me3.com
------------------------------
Date: Sun, 14 May 2000 14:20:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: newbie question / extract records between patterns
Message-Id: <slrn8htrjp.thn.tadmc@magna.metronet.com>
On Sun, 14 May 2000 15:17:35 GMT, scherer6744@my-deja.com <scherer6744@my-deja.com> wrote:
>I have files of the following structure.
[snip]
>Now i have to extract the leading strings with the corresponding lines
>e.g. in an array to make further work on them.
---------------------
#!/usr/bin/perl -w
use strict;
my $string;
my @lines;
while (<DATA>) {
if ( /^String/ ) { # start of new record
if ( defined $string ) { # process if not first line of first record
# process previous accumulated record
print "header = $string";
print " $_" foreach @lines;
}
$string = $_; # remember new key string
@lines = (); # empty out the array of lines
}
else { # add to current record
push @lines, $_;
}
}
# process last record
print "header = $string";
print " $_" foreach @lines;
__DATA__
String1
s1-1
s1-2
s1-3
String 2
s2-1
s2-2
s2-3
s2-4
String 3
s3-1
s3-2
---------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 14 May 2000 14:29:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Reading/searching file problem
Message-Id: <slrn8hts4l.thn.tadmc@magna.metronet.com>
On Sun, 14 May 2000 12:47:39 +0200, Jimmy Lantz <webmaster@ostas.lu.se> wrote:
>I need to read a file and search for a match according to the following criterias:
>
>
>$match = KIN213:;
That is a syntax error.
You should put quotes around strings.
>open(IN, "$file");
^ ^
^ ^
Those quotes serve no purpose other than making your code hard to read.
You should always, yes *always*, check the return value from open
(and include $! in the diagnostic message):
open(IN, $file) || die "could not open '$file' $!";
>How do I match the line in the file ???? And set the text to var $titel ?
^^^^^
The way is says in the manual that came with your perl distribution.
You are expected to check the Perl FAQs *before* posting
to the Perl newsgroup.
perldoc -q match
You are expeced to look around in the standard docs a little
*before* you ask thousands of people to help you.
perldoc perlre
perldoc perlop
>Pls. someone help me.
We will help you.
We will not do it for you.
1) Read the docs that came with your perl
2) Include the code that you have already tried
(real code that we can run, not pseudo code like you did above)
Then someone can help you fix your code.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 14 May 2000 19:36:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sorry repost i need help despertly can someone just look what is wrong
Message-Id: <8fmrnv$pav$1@orpheus.gellyfish.com>
On Sat, 13 May 2000 23:35:55 GMT velocity wrote:
> Can any of you guys tell me why this program wont work.
<snip>
I dunno I would start with this :
#!/usr/bin/perl -w
use strict;
use Net::NNTP;
my $news = Net::NNTP->new('my.news.host') || die "Can't connect - " ;
if ( $news->postok())
{
my @message = split /\n/,<<`EOMESS`;
From: velocity <velocity@youreallythinkitsme.com>
Subject: Test
Newsgroups: misc.test
'What CAN you mean by talking in this way to ME!' thundered
Heathcliff with savage vehemence. 'How - how DARE you, under my
roof? - God! he's mad to speak so!' And he struck his forehead
with rage.
EOMESS
$news->post(@message) || die $news->message;
}
else
{
die "Cant post to this host\n";
}
By the time you read this I will have advised the open news relay you are
using BTW.
/J\
--
We monorail conductors are a crazy breed!
--
fortune oscar homer
------------------------------
Date: 14 May 2000 21:22:35 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: sorry repost i need help despertly can someone just look what is wrong
Message-Id: <958339253.5451@itz.pp.sci.fi>
In article <vFlT4.62102$fF5.1953994@news1.rdc1.il.home.com>, velocity wrote:
>Can any of you guys tell me why this program wont work.
>It's a simple news poster allowing header hacking.
> It seems to work, but no posts show up on usenet.
[snip]
>use Socket;
>$iaddr = inet_aton($server) || die "no host reachable at:
>$server";
>$proto = getprotobyname('tcp');
>$paddr = sockaddr_in($port, $iaddr);
>socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
>connect(SOCK, $paddr) || die "connect: $!";
Do yourself a favor and use Net::NNTP. It works for me..
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Sun, 14 May 2000 14:06:23 +0100
From: "Andy Chantrill" <andy@u2me3.com>
Subject: Re: spoofing identity
Message-Id: <8fm8cr$60l$1@neptunium.btinternet.com>
There's a pretty simple way to do that ... but if you want to piss a lot of
people off then you really ought to think of it yourself.
As others have said, you should try and strike a repore with the site you
want to pimp information off, rather than just trying to rape it at will ...
HTH :o)
Andy.
------------------------------
Date: Sun, 14 May 2000 19:54:17 GMT
From: vuulza@my-deja.com
Subject: Re: tie 'MLDBM' from a CGI script not working -- any clues?!!
Message-Id: <8fn096$367$1@nnrp1.deja.com>
In article <391B32CD.75916483@rpi.edu>,
justin baugh <baughj@rpi.edu> wrote:
> > Here's a partial snippet; the message ($msg) returned is always the
> > same: Cannot tie. No such file or directory.
> >
> > sub write_to_file {
> > my %dbdata; my %tempdata;
> > my $key; my $last = 0; my $id; my $name;
> > tie(%dbdata, 'MLDBM', $dbfile) or $msg = $msg . "Cannot
tie. $!
> > <p>\n";
>
> This will fail if the database doesn't exist. Also, is $dbfile a
> global?
>
> If you want to create a database when one isn't found, use this:
>
> tie %dbdata, 'MLDBM', $dbfile, O_RDWR | O_CREAT or die
> "Cannot tie to database $dbfile: $!";
>
> (btw you should use die there instead of $msg = $msg)
>
> The O_RDWR and O_CREAT are flags (man open will tell you more about
> these). O_CREAT tells tie to create the database if it doesn't
exist,
> and O_RDWR indicates that the database can be read from and written
> to.
>
> Hope this helps,
>
> ~j
Thanks for the reply, but it's still not working ... $dbfile is global;
it exists (I've tried it with the dbfile in various directories,
too) ... and die doesn't help when you need output to a webpage (which
is why I use a custom error-generating script) ... I think I might give
up on MLDBM and use some other DB.
--cp
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 14 May 2000 11:48:31 -0700
From: "Baris" <sumengen@hotelspectra.com>
Subject: using an array from the disk
Message-Id: <391ef460$1_1@goliath2.newsfeeds.com>
Hello,
I am using a stack (array) in my program, I (shift) elements once in a
while, but I (push) more elements to the array. The array gets bigger and
bigger (upto 20,000+ elements) and it will become a memory hog.
I want to use this array on harddisk to solve this problem. What is the best
way to handle this array?
Baris.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: 14 May 2000 08:52:05 +0100
From: Edward Avis <epa98@doc.ic.ac.uk>
Subject: Re: Using user-variables in external commands?
Message-Id: <xn9d7mp4li2.fsf@texel25.doc.ic.ac.uk>
Anonymous Sender <nobody@mixmaster.shinn.net> writes:
>I know that I have to escape chars if
>I use something like that:
>
>system("sendmail $recipient");
>
>because someone can do nasty things with
>that, but how is it if I use the following:
>
>open(MAIL,"| sendmail");
>print <<MAIL;
>To: $recipient
>Can someone here also do nasty things?
Yes, suppose they set $recipient to:
"me@me.com\nCc: somebody@else.com"
which contains an embedded newline. They could add as many extra
headers to the message as they wanted, or even change the message
body.
>And how can I savely send mails by
>allowing _all_ characters?
You can't. In any case there's no reason why you should want to allow
all characters - there's only a limited set of characters that can
appear in an SMTP address.
I would suggest you find a module on CPAN to validate SMTP addresses
for you, and run $recipient and any similar strings through that.
Even if security were not a concern, it would still make your program
a lot more robust and stop it from doing stupid things if fed the
wrong input. You should always do at least a basic sanity check on
anything the user gives you.
Also find out what the -T (taint) switch does, and use it.
--
Ed Avis
epa98@doc.ic.ac.uk
------------------------------
Date: 14 May 2000 18:30:24 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Using user-variables in external commands?
Message-Id: <958328472.17488@itz.pp.sci.fi>
In article <8fifol$qmv$1@newsflash.concordia.ca>, Michael J Assels wrote:
>1. Yes. Someone can still do nasty things:
>
> $recipient =<<EOWORM;
>prisoner-of-bill@somewhere.com
>Subject: ILOVEYOU
>Content-Type: multipart/mixed;
> boundary="----=_NextPart_000_00E9_01BFB5D9.02FA44F0"
[snipped fragment of loveletter worm]
>
>2. You can't send mail safely by allowing all characters.
Well, that's not really anywhere as nasty as passing tainted data to a
shell. All you can do this way is send an arbitrary e-mail message,
which anyone can pretty much do anyway through their own mailserver.
Besides, the problem is easily fixed: $recipient =~ s/\n/\n\t/g;
[Followups narrowed.]
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Sun, 14 May 2000 16:55:29 -0500
From: "Andrew N. McGuire" <anmcguire@ce.mediaone.net>
Subject: Re: where can i find perl?
Message-Id: <391F20D1.E83715BC@ce.mediaone.net>
Christian Winter wrote:
>
[ snip ]
> P.S.:
> A real name for real people is a nice thing to have.
True, but the netiquette specifies that people should
respect other peoples wish for anonymity. I, do however
agree that a real name is nice. :-)
Regards,
anm
--
/*-------------------------------------------------------.
| Andrew N. McGuire |
| anmcguire@ce.mediaone.net |
`-------------------------------------------------------*/
------------------------------
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 3043
**************************************