[15998] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3410 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 18 03:16:39 2000

Date: Sun, 18 Jun 2000 00:15:32 -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: <961312532-v9-i3410@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 18 Jun 2000     Volume: 9 Number: 3410

Today's topics:
    Re: my vs. our <care227@attglobal.net>
    Re: need quick regexp help! <lauren_smith13@hotmail.com>
    Re: need quick regexp help! <lr@hpl.hp.com>
        Newlines again, was Re: Ugh <flavell@mail.cern.ch>
    Re: Newlines again, was Re: Ugh (jason)
        OT: Re: A Computer Programmers Profile <lr@hpl.hp.com>
    Re: OT: Re: A Computer Programmers Profile <care227@attglobal.net>
    Re: perl CGI on an Linux based apache webserver <Michael.Siemens@nospamhome.com>
        perl returning hash of my variables tlars@my-deja.com
    Re: perl returning hash of my variables (jason)
        Perlmagick and CGI bann3094@my-deja.com
    Re: Phonetic searching - Any Examples? <lauren_smith13@hotmail.com>
    Re: Place to run programs <abe@ztreet.demon.nl>
    Re: Place to run programs <fromnews@pagepool.co.uk>
        ppm will not work. I get this error message. <unknown@hfx.com>
    Re: print pdf <dparrott@ford.com>
    Re: print pdf tbb85@my-deja.com
    Re: print pdf <randy@theoryx5.uwinnipeg.ca>
    Re: qw() question, please advise me! <lauren_smith13@hotmail.com>
    Re: read single chars <trevor@trevorsky.com>
    Re: read single chars <abe@ztreet.demon.nl>
    Re: Recruiting for a perl CGI expert <russ_jones@rac.ray.com>
    Re: Referer Security : http://username:password URL's <lr@hpl.hp.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 13 Jun 2000 15:10:04 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: my vs. our
Message-Id: <642A954DD517D411B20C00508BCF23B001291B30@mail.sauder.com>

tlars@my-deja.com wrote:
> 
> Can anyone explain the difference between my and our in Perl?
> 

my creates a copy of the variable specific to the enclosing 
block.  I have never heard of a scoping element called our,
and my Perl docs contain no reference to it.



------------------------------

Date: Tue, 13 Jun 2000 15:57:35 -0400
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: need quick regexp help!
Message-Id: <642A954DD517D411B20C00508BCF23B001292B5A@mail.sauder.com>


Young <no_email@no_email.com> wrote in message
news:39468CA2.1711D54A@no_email.com...
> $info2 = "BEGINstart aldsf asdflj end end2 end3FINISH";
> $info2 =~ s/start.*end//g;
>
> print $info2;
>
> I get "BEGIN3FINISH" but what I want is:
>
> "BEGIN end2 end3FINISH"
>
> In other words, I want to remove every string beginning with 'start' and
> ending with 'end', but I don't want any occurrences of 'end' within the
> removed strings.

You need to be less greedy.

$info2 =~ s/start.*?end//g;

See perlre for more on greediness.

Lauren





------------------------------

Date: Tue, 13 Jun 2000 16:04:31 -0400
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: need quick regexp help!
Message-Id: <642A954DD517D411B20C00508BCF23B001292B66@mail.sauder.com>

In article <39468CA2.1711D54A@no_email.com> on Tue, 13 Jun 2000 15:33:54 
-0400, Young <no_email@no_email.com> says...
> $info2 = "BEGINstart aldsf asdflj end end2 end3FINISH";
> $info2 =~ s/start.*end//g;
> 
> print $info2;
> 
> I get "BEGIN3FINISH" but what I want is:
> 
> "BEGIN end2 end3FINISH"
> 
> In other words, I want to remove every string beginning with 'start' and
> ending with 'end', but I don't want any occurrences of 'end' within the
> removed strings.
> 
> How do I do it? Thanks in advance!

Use 'non-greedy' (abstemious? :-) matching.

  $info2 =~ s/start.*?end//g;

I copied your /g on that, but is there really more than one occurrence 
per string?  If not, leave it off.

Normally, I would now say

   perldoc perlre

But having just disparaged that as a tutorial, I refer you to the Web 
for a regex tutorial.  This general tutorial has gotten good reviews, 
and isn't restricted to Win32, despite its name:

   <URL:http://www.netcat.co.uk/rob/perl/win32perltut.html>

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com



------------------------------

Date: Sat, 17 Jun 2000 09:23:08 -0400
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Newlines again, was Re: Ugh
Message-Id: <642A954DD517D411B20C00508BCF23B0012935A4@mail.sauder.com>

On Sat, 17 Jun 2000, jason wrote:

> Bart Lateur writes ..
> >n.b. The meaning of "\r" and "\n" is platform dependent. On a Mac, "\n"
> >is chr(13) (because that is what the Mac uses), and "\r" is "the other
> >one", i.e. chr(10).

> the meaning is only platform dependant when reading from or writing to a 
> non-binmoded filehandle

Are you disagreeing with what you quoted?  I'd prefer what it says
in perldoc perlport about newline representations.

This has come up quite a few times on the group in the not so distant
past, but I've never seen here on usenet a better explanation than
what appears in the perlport documentation: if anyone thinks they can
do better, then I reckon they should be offering their assistance with
the documentation.

It could be that in your current predicament you're only interested in
unix versus windows, but that's no reason to go contradicting someone
who's talking about the broader principles, Macs etc.

> read from a text filehandle on Windows and all CRLF sequences are 
> converted to LFs .. and the reverse is done on a write

Yes, so far so good.  But the general statement that 'The meaning of
"\r" and "\n" is platform dependent' is a general truth, which
includes Macs, IBM mainframes, VMS etc.

> the 'meaning' inside the Perl code is the same - and platform 
> independent .. 

Only if you're consistent in your notation.

 Perl uses \n to represent the ``logical'' newline, where
 what is logical may depend on the platform in use. In
 MacPerl, \n always means \015. In DOSish perls, \n usually
 means \012, but when accessing a file in ``text'' mode,
 STDIO translates it to (or from) \015\012. 

> the only magic happens when writing to or from a non-
> binmoded filehandle

You're still not addressing the general problem, but only this one
detail in which DOS/Windows differs from unix.

Even then, if someone has transferred a text file cross-platform in
binary mode, and are attempting to use Perl to read the resulting
heap, there's extra work to be done.  The same is true when using
Samba (and PCNFS, as I recall) to share files cross-platform between
DOS/Windows and unix systems. The consistency only extends to using
the standard i/o routines to process files that are in their own
platform's native text format.

See the perlport doc for additional comments about socket programming.

cheers



------------------------------

Date: Sun, 18 Jun 2000 06:45:41 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Newlines again, was Re: Ugh
Message-Id: <MPG.13b70d4ce71dc37e989746@news>

Alan J. Flavell writes ..
>> read from a text filehandle on Windows and all CRLF sequences are 
>> converted to LFs .. and the reverse is done on a write
>
>Yes, so far so good.  But the general statement that 'The meaning of
>"\r" and "\n" is platform dependent' is a general truth, which
>includes Macs, IBM mainframes, VMS etc.

is there some confusion with my use of the phrase "on Windows" ?? .. get 
some context - this thread was originated by someone who was developing 
on Windows and then transporting their code to UNIX

I made a comment about some code that was proposed as a solution to the 
originator's line ending problem .. the comment I made was that the post 
containing the code should contain a caveat that the code would only 
work if run on the UNIX side of the transfer

nothing that you or Bart have said makes that statement any less useful 
to the originator .. and everything regarding platforms other than UNIX 
and Windows belongs in a different discussion targetting a different 
poster - because it was not an issue that I was addressing

>You're still not addressing the general problem, but only this one
>detail in which DOS/Windows differs from unix.

I never tried to - nor wanted to - nor have any expertise to address any 
problem other than the one of the originator - specifically changing 
Windows line endings to UNIX ones

>See the perlport doc for additional comments about socket programming.

read it .. know it .. was commenting on a tiny sub-section of it

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: Fri, 16 Jun 2000 17:05:19 -0400
From: Larry Rosler <lr@hpl.hp.com>
Subject: OT: Re: A Computer Programmers Profile
Message-Id: <642A954DD517D411B20C00508BCF23B0012933EE@mail.sauder.com>

In article <394A7DE2.4D6B9D90@rac.ray.com> on Fri, 16 Jun 2000 14:20:02 
-0500, Russ Jones <russ_jones@rac.ray.com> says...
> Larry Rosler wrote:
> > 
> > Drew Simonis wrote:
> > > Ferk Da Jerk wrote:
> > > > children are more stronger than the adults.
> > >                ^^^^^^^^^^^^^
> > > And oh the grammer!
> > 
> > Is that Kelsey Grammer or English grammar?
> 
> Poor grammar is one thing up with which we must not put.
> 
>  - Winston Churchill

I thought that was 'Ending a sentence with a preposition is one thing up 
with which we must not put.'

Which reminds me of the convict who was knifed to death in the prison 
shower room.  He ended his sentence with a proposition.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com



------------------------------

Date: Fri, 16 Jun 2000 17:22:11 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: OT: Re: A Computer Programmers Profile
Message-Id: <642A954DD517D411B20C00508BCF23B0012933FD@mail.sauder.com>

Larry Rosler wrote:
> 
> 
> Which reminds me of the convict who was knifed to death in the prison
> shower room.  He ended his sentence with a proposition.


Oh my.  That is rather funny.



------------------------------

Date: Mon, 12 Jun 2000 18:26:07 -0400
From: "Michael.Siemens" <Michael.Siemens@nospamhome.com>
Subject: Re: perl CGI on an Linux based apache webserver
Message-Id: <642A954DD517D411B20C00508BCF23B001291944@mail.sauder.com>

thank you for your feed back! you are correct, I did type the wrong file
name in this example... however, the problem is real
here is a partial screen capture that has me trying to execute the correct
filename  =)

root@csg:/usr/local/httpd/cgi-bin > ls -l
total 963
-rw-r--r--   1 root     root         1167 Nov 17  1998 CdbCli.pm
-rw-r--r--   1 root     root         5786 Nov 17  1998 CdbHtml.pm
-rwxr-xr-x   1 root     root         9275 Nov 18  1998 cdb.cgi
-rwxr-xr-x   1 root     root        22588 Dec 13  1998 cdbsimple.cgi
-rwxr-xr-x   1 root     root         4842 Jun 11 15:51 contact.cgi
-rwxr-xr-x   1 root     root         4559 Nov 18  1998 detail.cgi
-rwxr-xr-x   1 root     root       851892 Apr 14  1999 htsearch
-rwxr-xr-x   1 root     root        20584 Apr 14  1999 info2html
-rw-r--r--   1 root     root         1529 Apr 14  1999 info2html.conf
-rwxr-xr-x   1 root     root          199 Feb 28 21:15 mail-form.cgi
-rwxr-xr-x   1 root     root          196 Jun 11 20:27 mail-form.pl
-rwxr-xr-x   1 root     root         4277 Jun 12 01:18 mailer
-rwxr-xr-x   1 root     root         4277 Jun 12 01:25 mailer.pl
-rwxr-xr-x   1 root     root          598 Jun 12 01:47 mailme.cgi
-rwxr-xr-x   1 root     root          598 Jun 12 01:50 mailme.pl
-rwxr-xr-x   1 root     root         1937 Jun 11 15:51 myversion.cgi
-rwxr-xr-x   1 root     root          120 Apr 14  1999 printenv
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_en
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_es
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_faq
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_fr
-rwxr-xr-x   1 root     root         5095 Apr 19  1999 sdbsearch_it
drwxr-xr-x   2 root     root         1024 Nov 30  1999 sdbtxt
-rwxr-xr-x   1 root     root          757 Apr 14  1999 test-cgi
-rwxr-xr-x   1 root     root          400 Apr 14  1999 test.pl
root@csg:/usr/local/httpd/cgi-bin > ./mail-form.pl
bash: ./mail-form.pl: No such file or directory
root@csg:/usr/local/httpd/cgi-bin >


got any ideas?



"Bart Lateur" <bart.lateur@skynet.be> wrote in message
news:394abc38.5354473@news.skynet.be...
Michael.Siemens wrote:

>-rwxr-xr-x   1 root     root          201 Feb 28 20:28 mail-form.pl

>root@csg:/usr/local/httpd/cgi-bin > ./mailform.pl
>bash: ./mailform.pl: No such file or directory
>root@csg:/usr/local/httpd/cgi-bin >

It doesn't look to me like it's the same filename.

--
Bart.




------------------------------

Date: Wed, 14 Jun 2000 17:34:16 -0400
From: tlars@my-deja.com
Subject: perl returning hash of my variables
Message-Id: <642A954DD517D411B20C00508BCF23B001292DD3@mail.sauder.com>

I'd like to write a perl module such that I can copy the values of all
package level "my" variables (assume module has only one package) into
a hash and return a ref to the hash.

package Test;

my one = "hello";
my two = "hi";
my three = "howdy";

sub returnAllVariables {
  ...code here...
}

--------
somewhere in program
--------

 $href = Test::returnAllVariables();

 #now
 # $href->{one} is "hello"
 #$href->{two} is "hi"
 #$href->{three} is "howdy"

I really don't need to use "my" variables. I could use package scoped
dynamic vars.  However, I'd like to make the variables invisible
outside the package or  make the variables constants.  I know that my
is any easy way to make the variables invisible. Not sure how to make
the vars constant.  "use constant" did not seem like it would work in
this case.

Basically, I'm trying to mimic the properties files in Java.  Any ideas.

Thanks,

tlars


Sent via Deja.com http://www.deja.com/
Before you buy.



------------------------------

Date: Sun, 18 Jun 2000 06:16:08 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: perl returning hash of my variables
Message-Id: <MPG.13b7065e5b17b52f989743@news>

tlars@my-deja.com writes ..
>I'd like to write a perl module such that I can copy the values of all
>package level "my" variables (assume module has only one package) into
>a hash and return a ref to the hash.

'my' variables are completely package independant .. the phrase 'package 
level "my" variables' does not make sense .. they are lexically declared 
and have block or file scope .. unlike package variables there is no 
internal list held - and no way to iterate through them as it appears 
you wish to do

>I really don't need to use "my" variables. I could use package scoped
>dynamic vars.  However, I'd like to make the variables invisible
>outside the package or  make the variables constants.

how could you possibly write a module that is able to copy the values of 
all variables in a package if the variables in that package are 
invisible outside the package ??

I'm guessing that what you're ACTUALLY wanting is to not permit a 
calling package to modify the values of these variables that you're 
talking about .. in which case you're using the wrong language

>Basically, I'm trying to mimic the properties files in Java.  Any ideas.

now you've really lost me .. mimic a name-value pair file ? .. did you 
have a look at one of the numerous modules to do this ?

check out FreezeThaw, Data::Dumper and Storable on CPAN

-- 
 jason - elephant@squirrelgroup.com -


------------------------------

Date: Wed, 14 Jun 2000 02:10:54 -0400
From: bann3094@my-deja.com
Subject: Perlmagick and CGI
Message-Id: <642A954DD517D411B20C00508BCF23B001292D01@mail.sauder.com>

Hello,

I am using perlmagick to manipulate images.  The problem that I am
having is that when I run the script from the command line the script
works fine, but if I run the script as a CGI, perlmagick cannot find the
images. The image files and the directories  have the correct
permissions.

If anybody can help me I would gretly appreciate it.

Roger,

Enclosed is a sample script that tries to read images from a directory,
but fails:

#!/opt/local/bin/perl

use Image::Magick;
$image1 = Image::Magick->new(magick=>'jpg');

opendir(IMGDIR, "/res/w3sllim/www/cgi-bin/imgdb/temp") ||
      die("Unable to open directory");
@files = readdir(IMGDIR);

print "Content-type: text/html\n\n";
foreach $file (sort @files) {
     next if (($file == '\.') || ($file == '\.\.'));
    $image1->Set(filename=>"/res/w3sllim/www/cgi-bin/imgdb/temp/$file");

    $xx = $image1->Read();
    print ("$xx:$file\n");
}

exit 0;

Error Message:

Warning 315: no delegates configuration file found (delegates.mgk) [No
such file or directory]
Warning 320: no delegate for this image format
(/res/w3sllim/www/cgi-bin/imgdb/temp/296.jpg)
Warning 320: no delegate for this image format
(/res/w3sllim/www/cgi-bin/imgdb/temp/422.jpg)


Sent via Deja.com http://www.deja.com/
Before you buy.



------------------------------

Date: Tue, 13 Jun 2000 15:22:27 -0400
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Phonetic searching - Any Examples?
Message-Id: <642A954DD517D411B20C00508BCF23B001291B42@mail.sauder.com>


Guy Fraser <guy@firstcreative.com> wrote in message
news:8i5vpq$9or$1@plutonium.compulink.co.uk...
> Hi All.
>
> I'm trying to build a glossary where the user can search through it to
find
> a description for a word.
>
> The client has just asked that a "sounds like" option would be good so
I've
> been reading up on Text::Metaphone
>
> Seems like the tool I need but I can't find any examples of using it :o(
>
> Does anyone know of a good example of phonetic searching (or any other
cool
> search routines) as I'm pulling my hair out here trying to work out how to
> do it whilst doing about 16 other jobs at the same time!

If you had 2 tied hashes, one for the glossary and one for the 'sounds like'
group, it would seem straightforward.

The glossary hash would just be a list of terms with their meanings as
values.  Lookup would be relatively simple, I would imagine.

The other group would be a hash of lists in which each key would be a
soundex and the value would be a list of terms that hash to the same
soundex.

$soundex = Metaphone($term);
push @{ $sounds_like{$soundex} }, $term;

Then if the users selects 'sounds like', just return the list of terms that
fit that particular soundex.

$soundex = Metaphone($user_entry);
@matching_terms = @{ $sounds_like {$soundex } };

Does this look like it might help?

Lauren





------------------------------

Date: Mon, 12 Jun 2000 18:16:45 -0400
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Place to run programs
Message-Id: <642A954DD517D411B20C00508BCF23B001291947@mail.sauder.com>

On Mon, 12 Jun 2000 21:38:02 +0100, "James" <fromnews@pagepool.co.uk>
wrote:

> I am completely new to perl - I got my first book this evening.  Can anyone
> tell me where I can run the programs on a Windows 98 PC?

at home?

-- 
Good luck,
Abe



------------------------------

Date: Tue, 13 Jun 2000 02:03:05 -0400
From: "James" <fromnews@pagepool.co.uk>
Subject: Re: Place to run programs
Message-Id: <642A954DD517D411B20C00508BCF23B001291A6A@mail.sauder.com>

Thank you if you gave a sensible answer.
"Steve Leibel" <stevel@coastside.net> wrote in message
news:stevel-1206001627180001@192.168.100.2...
> In article <q9oaks06mn8bshehrkosib44ukq0p441q6@4ax.com>, Abe Timmerman
> <abe@ztreet.demon.nl> wrote:
>
> > On Mon, 12 Jun 2000 21:38:02 +0100, "James" <fromnews@pagepool.co.uk>
> > wrote:
> >
> > > I am completely new to perl - I got my first book this evening.  Can
anyone
> > > tell me where I can run the programs on a Windows 98 PC?
> >
> > at home?
>
>
> Hell no that cuts into valuable TV time.  I'd do it at work.




------------------------------

Date: Tue, 13 Jun 2000 02:46:16 -0400
From: "unknown" <unknown@hfx.com>
Subject: ppm will not work. I get this error message.
Message-Id: <642A954DD517D411B20C00508BCF23B001291A8B@mail.sauder.com>

Can't locate HTML/HeadParser.pm in @INC (@INC contains: C:/Perl/lib
/lib .) at C:/Perl/site/lib/LWP/Protocol.pm line 47.
Compilation failed in require at C:/Perl/site/lib/LWP/UserAgent.pm
BEGIN failed--compilation aborted at C:/Perl/site/lib/LWP/UserAgent

Compilation failed in require at C:/Perl/site/lib/PPM.pm line 8.
BEGIN failed--compilation aborted at C:/Perl/site/lib/PPM.pm line 8
Compilation failed in require at C:\Perl\bin\ppm.bat line 21.
BEGIN failed--compilation aborted at C:\Perl\bin\ppm.bat line 21.


My system is win2000.




------------------------------

Date: Mon, 12 Jun 2000 22:43:49 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
Subject: Re: print pdf
Message-Id: <642A954DD517D411B20C00508BCF23B001291A1F@mail.sauder.com>

Todd Anderson wrote:
> 
> Dear Sirs,
> Does anybody know the perl command for printing a pdf (portable document
> file) file, the way you might print an html file? Can it even be done?
> Thanks in advance for your help.
> 
> SNIP!

The answer is OS-dependant. On Windows, you can do some magic to access
the underlying mechanisms in Adobe Acrobat and make the PDF print.

On Unix, VMS, etc., the answer is "probably not" unless the Adobe SDKs
have a way.

Many of the "freeware" PDF tools allow you to create PDFs or manipulate
them in strange and (possibly) creative ways. I do not recall ever
seeing
one that would print them for you.



------------------------------

Date: Sat, 17 Jun 2000 08:01:29 -0400
From: tbb85@my-deja.com
Subject: Re: print pdf
Message-Id: <642A954DD517D411B20C00508BCF23B001293589@mail.sauder.com>


> Wait a minute... You don't want to *print* a PDF file (= send to
> printer), you want to *generate* a PDF file! Well, er, go to
> <http://search.cpan.org/> and look up "PDF". There are a number of
alpha
> softwares there, which might do this in a way you like. PDF::Create
> looks cute.
>
> --
> 	Bart.
>

I'm wondering which of the PDF modules listed on CPAN would be the best
to spend time installing and evaluating.  I need the capability to
insert GIF or JPG images into my PDF output files.  I looked through
some of the documentation for PDF::Create, but don't see any reference
to handling images.

http://search.cpan.org/doc/FTASSIN/PDF-Create-0.01/lib/PDF/Create.pm

Tony


Sent via Deja.com http://www.deja.com/
Before you buy.



------------------------------

Date: Sat, 17 Jun 2000 11:28:20 -0400
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: print pdf
Message-Id: <642A954DD517D411B20C00508BCF23B0012935A7@mail.sauder.com>

In comp.lang.perl.misc, tbb85@my-deja.com wrote:

> I'm wondering which of the PDF modules listed on CPAN would be the best
> to spend time installing and evaluating.  I need the capability to
> insert GIF or JPG images into my PDF output files.  I looked through
> some of the documentation for PDF::Create, but don't see any reference
> to handling images.

Try http://www.pdflib.com/ - this is a library of pdf functions
that has that capability. There's also a perl binding included.

best regards,
randy kobes



------------------------------

Date: Tue, 13 Jun 2000 18:28:25 -0400
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: qw() question, please advise me!
Message-Id: <642A954DD517D411B20C00508BCF23B001292BBA@mail.sauder.com>


<law_40@hotmail.com> wrote in message news:8i6ajc$k13$1@nnrp1.deja.com...
>
> @array=qw("this is some text");
>
> this stores in the @array variable four words,
>
> @array[0], @array[1], @array[2], and @array[3]....

Of course the values of those are:
[0] "this
[1] is
[2] some
[3] text"

Are those quotes necessary?

>
> however, if I define a variable,
>
> $text="this is some text";
> then use,
>
> @array=qw($text);
>
> it does not work.  @array only gets assigned @array[0]=$text...

You are looking to 'split' the string into its tokens.

@array = split (/ /, $text);

perldoc -f split

Lauren





------------------------------

Date: Fri, 16 Jun 2000 17:38:09 -0400
From: "Trevor Sky Garside" <trevor@trevorsky.com>
Subject: Re: read single chars
Message-Id: <642A954DD517D411B20C00508BCF23B00129340F@mail.sauder.com>

"Tim" <tcuffel@exactis.com> wrote in message
news:mBu25.2725$Ck1.292331@den-news1.rmi.net...
>
> Oliver Soeder wrote in message
<394A71A2.788F9B12@ai-lab.fh-furtwangen.de>...
> >Hello I have a stupid question, but I am a novice.
> >
> >$chars=<STDIN>
> >
> >This reads in a string, how can i read it as single chars?
>
>
> Do this first:
>
> $/ = \1;
>
> $/ is the input separator, normally set to \n.  However, if you set
> it to a reference to an integer, it read no more than that many
> characters at a time.  This is to support fixed length non delimited
> records, but it works for your situation as well.

Don't forget to set $/ back to "\n" when you're done.

--Trevor




------------------------------

Date: Fri, 16 Jun 2000 21:41:30 -0400
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: read single chars
Message-Id: <642A954DD517D411B20C00508BCF23B001293472@mail.sauder.com>

On Fri, 16 Jun 2000 13:26:25 -0500, "Tim" <tcuffel@exactis.com> wrote:

> Tad McClellan wrote in message ...
> >On Fri, 16 Jun 2000 20:27:46 +0200, Oliver Soeder <soeder@ai-lab.fh-furtwangen.de> wrote:
> >
> >>but I am a novice.
> >
> >
> >That is no excuse.
> >
> >Usenet practice *requires* that you check the FAQ before posting.
> >
> >There is no exception for novices.
> 
> 
> [snip]
> 
> A little quick with the trigger finger there, cowboy...
> 
> His full question boiled down to "Can I read one character from a file
> using <> syntax?"
> 
Did you actually read the question? 
Did you actually read the answer in perlfaq5?

[quoted from OP]
> $chars=<STDIN>
> This reads in a string, how can i read it as single chars?

Now I can make a lot of that, but I never would have come up with your
interpretation. Can we dismiss <STDIN> as a clue, it's not just _any_
filehandle.
Lauren's answer looks like a good job to me.

You seem a bit trigger-happy yourself :-)

-- 
Good luck,
Abe



------------------------------

Date: Fri, 16 Jun 2000 09:09:54 -0400
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Recruiting for a perl CGI expert
Message-Id: <642A954DD517D411B20C00508BCF23B001293610@mail.sauder.com>

"David H. Adler" wrote:
> 
> On Fri, 9 Jun 2000 14:26:10 +1000, Russell Banks
> <russellb@decideinteractive.com> wrote:
> 
> >If you fit the following job description, please contact us by email
> 
> You have posted a job posting or a resume in a technical group.
> 

etc etc etc

I'm pretty sure that "David H. Adler" is a bot, too.

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

When cryptography is outlawed, only outlaws will
A2bgg c4dc8 aji0i knS4E 7eFj8 22Rl1
ZdGg3 gu8i6 lu12N s6NoG gn3g3 q835n



------------------------------

Date: Fri, 16 Jun 2000 17:19:30 -0400
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Referer Security : http://username:password URL's
Message-Id: <642A954DD517D411B20C00508BCF23B00129340C@mail.sauder.com>

In article <slrn8kl35l.mlf.abigail@alexandra.delanet.com> on 16 Jun 2000 
16:07:03 EDT, Abigail <abigail@delanet.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote on MMCDLXXXI September MCMXCIII in
> <URL:news:MPG.13b412d34c086b2898ab90@nntp.hpl.hp.com>:
> {} In article <8idk0i$tc7$1@nnrp1.deja.com> on Fri, 16 Jun 2000 16:18:46 
> {} GMT, Makau Divangamene <makau@multimania.com> says...
> {} > 
> {} > If you want to verify this, go to : www.club-fripons.com
> {} > At the bottom of the page, it will show you the FULL URL you came from!
> {} 
> {} You prick!  Thanks for posting a URL that might have cost me my job had 
> {} my boss just happened to wander by when I was accessing it.
> 
> While I don't want to imply that I think Makau was right in posting what
> he did, I think it's silly to just follow links from Usenet postings
> if you work in a situation that accessing a single web site can get
> you fired.

Yeah.  Well, the firing is theoretical, as I could simply point to the 
newsgroup message to which I was trying to respond.  (I doubt that they 
would fire me for doing that. :-)

But there has to be a certain amount of trust in this newsgroup.  This 
Makau has posted here many times, though usually not usefully, so 
presumably deserved some trust.  But evidently not!

I can feel violated, even without being actually raped.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com



------------------------------

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 3410
**************************************


home help back first fref pref prev next nref lref last post