[13218] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 628 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 24 07:09:32 1999

Date: Tue, 24 Aug 1999 04:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 24 Aug 1999     Volume: 9 Number: 628

Today's topics:
    Re: DBI, fetchrow_array and sorting (mysql) <michael.preminger@jbi.hioslo.no>
    Re: directory processing <gellyfish@gellyfish.com>
        help on semaphores in perl <sjain@uswest.com>
        help on semaphores in perl <sjain@uswest.com>
    Re: Image reading and browsing h.benne@library.uu.nl
    Re: Image reading and browsing <gellyfish@gellyfish.com>
    Re: Insecure $ENV{PATH} while running setuid at /dev/fd <Tim.Potter@anu.edu.au>
    Re: IO problem <jpeterson@office.colt.net>
        need examples on Net::NNTP module smnayeem@agni.com
        need script for fetching documents via POST. <username@hss.hns.com>
    Re: newbie: need help,LEARNING FROM A BOOK <steve.button@nl.origin-it.com>
        Perl Module Installation <polarbear_8@my-deja.com>
    Re: Perl newbie needs help with form mail security <jpeterson@office.colt.net>
    Re: short question - short answer <jpeterson@office.colt.net>
    Re: someone pleae help (Bart Lateur)
        spider - stripping useless words <contact@nativetongues.com>
    Re: spider - stripping useless words <jpeterson@office.colt.net>
        String problem! <o_k@mailexcite.com>
    Re: String problem! <jpeterson@office.colt.net>
    Re: testing <jpeterson@office.colt.net>
    Re: The logic of curly braces (Gary O'Keefe)
        The Perl debugger steveeq1@earthlink.net
        User's Operative Sistem???? <roco3d@softhome.net>
    Re: User's Operative Sistem???? <jpeterson@office.colt.net>
    Re: User's Operative Sistem???? <gellyfish@gellyfish.com>
        Where do I find h2xs? <pds@datcon.co.uk>
    Re: Where do I find h2xs? <gellyfish@gellyfish.com>
        Win32::OLE to read Word file <andrewf@beausys.freeserve.co.uk>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 24 Aug 1999 09:01:02 +0100
From: Michael Preminger <michael.preminger@jbi.hioslo.no>
Subject: Re: DBI, fetchrow_array and sorting (mysql)
Message-Id: <37C2513E.92B90192@jbi.hioslo.no>



Michael Budash wrote:

> $doc_id[1] points to the second field in the result, and should be
> undefined, since your query only had one field in the field list.
>

Not if I set $[=1;

> --
> | Michael Budash Consulting     | 707-252-7670 voice |
> | Perl, Javascript, PHP, MySQL  | 603-250-8679 fax   |
> | Official Extropia Developer   | mbudash@sonic.net  |

--
Michael Preminger

Forsker / Research Scientist
Avdeling for journalistikk,
bibliotek- og informasjonsfag /
Faculty of Journalism, Library and
Information Science
Hřgskolen i Oslo / Oslo College

http://www.hioslo.no/~michaelp

Pilestredet 52, N-0167 Oslo
Voice: +47-22452778
Fax:   +47-22452605
E-mail: michael.preminger@jbi.hioslo.no




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

Date: 24 Aug 1999 10:17:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: directory processing
Message-Id: <37c26312_1@newsread3.dircon.co.uk>

Billy Chan <bilchan@bigfoot.com> wrote:
> In article <7prldn$3db$1@nnrp1.deja.com>, pandey@my-deja.com says...
>> Hello,
>> I am new to perl. I am writing a function
>> to process a directory. It reads a directory
>> and processes all the files in that directory
>> one by one by a certain rule.
>> 
>> What are the constructs to use for this
>> operation?
> 
> opendir (DH,".");

Please always check the success of opendir:

  opendir(DH,".") || die "Couldnt open current directory - $!\n";

> @files=grep { /\.txt$/i } readdir DH;
> closedir(DH);
> 
> for ($i=0; $i<@files; $i++) {
>   print @files[$i];
> }

That is not really the most idiomatic Perl I have seen :

  foreach ( @files )
   {
     #do something with $_ containing filename here
   }

/J\
-- 
"Gary Glitter pulls out of Children in Need" - BBC News Website


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

Date: Mon, 23 Aug 1999 15:40:54 -0600
From: Samir Jain <sjain@uswest.com>
Subject: help on semaphores in perl
Message-Id: <37C1BFE6.49B3A976@uswest.com>

I am very new to perl programming and i am stuck with some coding
problem.

From a perl CGI program i am making a system call to an executable
written in k shell.
but more then one user can call this executable from the CGI program,
and i want to prevent that so that only one instance of  that executable
is running.

Please help ...

Thanks






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

Date: Mon, 23 Aug 1999 15:37:33 -0600
From: Samir Jain <sjain@uswest.com>
Subject: help on semaphores in perl
Message-Id: <37C1BF1D.6856E9CD@uswest.com>

I am very new to perl programming and i am stuck with some coding
problem.

From a perl CGI program i am making a system call to an executable
written in k shell.
but more then one user can call this executable from the CGI program,
and i want to prevent that so that only one instance of  that executable
is running.

Please help ...

Thanks






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

Date: Tue, 24 Aug 1999 10:31:50 GMT
From: h.benne@library.uu.nl
Subject: Re: Image reading and browsing
Message-Id: <7ptl4k$rr9$1@news1.xs4all.nl>

In article <slrn7s2lko.k6b.abigail@alexandra.delanet.com>, abigail@delanet.com wrote:

>And a C program doing the same won't do because of?

That will probably do also, but I'm not able to write or read the C program 
language. Apart from that I do not posses a C-compiler so Perl is the language 
for me I guess..

Hugo (h.benne@library.uu.nl)


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

Date: 24 Aug 1999 11:19:23 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Image reading and browsing
Message-Id: <37c271ab_1@newsread3.dircon.co.uk>

h.benne@library.uu.nl wrote:
> In article <slrn7s2lko.k6b.abigail@alexandra.delanet.com>, abigail@delanet.com wrote:
> 
>>And a C program doing the same won't do because of?
> 
> That will probably do also, but I'm not able to write or read the C program 
> language. Apart from that I do not posses a C-compiler so Perl is the language 
> for me I guess..
> 

Well that might be the case if you were thinking of writing this program
yourself but you explicitly said you were looking for an already made
program so what difference does the language make ?

Anyhow if you are going to write a program yourself you will
probably want to use opendir and readdir to get the files in the directory
and one of the modules GD or Image::Magick to create the thumbnails - you
will then use a bunch of print statements to generate the4 HTML.

/J\
-- 
"While we've been on the air we've had reports that Prince Charles has
eaten beef on the bone" - Justin Webb, BBC One O'Clock News


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

Date: 24 Aug 1999 17:24:42 +1000
From: Tim Potter <Tim.Potter@anu.edu.au>
To: mr_potato_head@my-deja.com
Subject: Re: Insecure $ENV{PATH} while running setuid at /dev/fd/4 line 2.
Message-Id: <6y90717i9x.fsf@acronym.anu.edu.au>

mr_potato_head@my-deja.com writes:

> Hi,
>    Ok, I give up.  I'm lame and I need help.  My problem is that I have
> the following script that I need to allow a user to run on my informix
> database.  This user needs to run this script as user "informix".  When
> I change the permissions on the script to "4755" and ran the scripts, I
> get  the following error: "Insecure $ENV{PATH} while running setuid at
> /dev/fd/4 line 2.".  Can anyone show me what line I need to add to get
> rid of this error?  Thanks in advance...

You have to explicitly set the PATH environment variable when running
setuid.

$ENV{PATH} = "/bin:/usr/bin";


Tim.

-- 
Tim Potter, System Admin/Programmer              "Disco Stu doesn't advertise"
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602


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

Date: Tue, 24 Aug 1999 08:52:53 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: IO problem
Message-Id: <F3tw3.255$u07.1811@news.colt.net>

seanfeng@my-deja.com wrote:
> I put together a script that uses LWP::UserAgent to get a live response.
>  It also creates a new sub-class of object from HTML::Parser in order
> to extract text from the HTML.  Problem is I need to collect all the
> text output, do a reg exp search for a set of keywords and their
> sub text {
>     my $self = shift;
>     my $text = shift;
>     my $line = HTML::Entities::decode( $text );
>     print $line if ($line =~ (/\S/));
                               ^^^^^^
> }

Do you really want those parens there? Maybe you just mean:

print $line if ($line =~ /\S/);

?



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

Date: Tue, 24 Aug 1999 08:01:49 GMT
From: smnayeem@agni.com
Subject: need examples on Net::NNTP module
Message-Id: <7ptjh8$iak$1@nnrp1.deja.com>

Can anyone send me some links to someplace where I can find some good
examples of the Net::NNTP module?
Also some shopping cart script examples also would be very useful to me.

Thanks in advance.

Nayeem
Programmer,
Agni Systems Ltd.
(please send me a copy of the reply to my email thnx :)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 24 Aug 1999 12:22:18 +0530
From: uma mohan <username@hss.hns.com>
Subject: need script for fetching documents via POST.
Message-Id: <37C24122.63F021A5@hss.hns.com>

Hi,

I want a perl script that will fetch a document with a  cgi/normal URL.
wget works fine for normal URL's but I dont' think it supports the POST
method.

The script should support both GET and POST methods, and preferably
should take all it's parameters thru command line (to automate it).

I know it should be quite trivial with libwww, but in case someone
already has it, it would help me avoid reinventing the wheel.

Such a script or a pointer to it would be very appreciated.

Thanks,
Lokesh Setia.




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

Date: Tue, 24 Aug 1999 12:19:05 +0200
From: "Steve Button" <steve.button@nl.origin-it.com>
Subject: Re: newbie: need help,LEARNING FROM A BOOK
Message-Id: <0E16861EE7BCD111BE9400805FE6841F0B166743@c1s5x001.cor.srvfarm.origin-it.com>


zev0@my-deja.com wrote in message <7psda7$mr8$1@nnrp1.deja.com>...
>I dont understand the concepts, of perl,when do you use " this and when
>do you use 'this,.

Not sure on this one. Would have to look it up.

>?2.) what means,exponentation,?and precedence?in
>simple jargon,even a newbie will understand,.

I think exponentation is sort of, multiplying things up. So if you have 3 x
3 x 3 x 3, it's three to the power of 4. And 4 is the exponent.... I think.
Why do you need to know this?  You should look up "exponent" in a
dictionary..... Actually I just did, I found one at www.dictionary.com and I
looked up exponent.... and it looks like I'm sort of right. Precedence means
"the order in which things are evaluated"  which means that for example, if
you say "3 + 2 * 4" the 2 * 4 bit will be evaluated first, giving an answer
of 11 (rather than 20 if you took 3 + 2 and then multiplied by 4).  You can
think of it a bit like priority.

You can also alter the precedence using brackets, such as (3 + 2) * 4. which
means take the stuff in brackets first.

By the way, Jargon by definition* means that it's difficult to understand.
That's why they invented it. It's a bit like how doctors give things really
long and hard to remember names, so that they feel important and more clever
than the rest of us. Computing is much worse (and always changing, to boot!)

 am learning from the book
>perl 5 interactive course

I found the book "Learning perl" very clear and readable.

>,i hope i can do it, with the communitys WEB
>help!does any perl programmer want to help me with corresponding
>through e-mail,?if i have any questions?on my journy,to become a perl,
>programmer,! THANK YOU!!!!!!

I will try and help you if you like, as long as it's not too often!
Otherwise I think you're in the right place. It would help you if you
structured your questions a bit more clearly.  OTOH, it would probably have
helped you even more if I had structured my answers more clearly  :-)  Oh
well, you get what you pays for!  I'm just bored in my lunch break, trying
to give some help.

Good luck,

Steve Button.


* ["Confused, unintelligible language; gibberish; hence, an artificial idiom
or dialect; "]

HuntAHome      http://www.huntahome.com
Properties throughout the UK and Europe
You can subscribe to receive a free daily email of all properties that match
your requirements (location, price, bedrooms)
You can advertise your property, with photograph, for free.




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

Date: Tue, 24 Aug 1999 07:45:39 GMT
From: polarbear <polarbear_8@my-deja.com>
Subject: Perl Module Installation
Message-Id: <7ptij1$hkd$1@nnrp1.deja.com>

Hi,

I am trying to install the perl module, POP3Client, and when I did a
'make install', it gives me the following error message,

Perl lib version (5.00502) doesn't match executable version (5.00503)
at
/usr/libdata/perl/5.00503/Config.pm line 7.
BEGIN failed--compilation aborted at
/usr/libdata/perl/5.00503/ExtUtils/Install.pm line 8.
BEGIN failed--compilation aborted.
*** Error code 255

I will appreciate if anyone can suggest a fix for this. I am currently
running FreeBSD 3.1.

Please e-mail.

Thank you.

Regards,
Seng Yip


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 24 Aug 1999 08:42:52 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Perl newbie needs help with form mail security
Message-Id: <gWsw3.253$u07.1811@news.colt.net>

Jeff Fox <jfox@airmail.net> wrote:

> On to the problem.
> server. This form calls Form Mail. Form Mail emails me the contents of
> the form. The problem is the email is plaintext, and it's supposed to
> contain credit card numbers. I need to encrypt the email, or use PGP,
> or something else to protect the CC number.

Well, if the web server has SSL, your encryption problems are solved. Instead
of mailing the form to you, simply write the contents of the form to a file 
that the web server can see. Then retrieve this file via https in your browser.
Of course you'll want to write to a password protected directory so that others
can't also see the credit card details.



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

Date: Tue, 24 Aug 1999 08:29:54 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: short question - short answer
Message-Id: <6Ksw3.251$u07.1811@news.colt.net>

Martien Verbruggen <mgjv@comdyn.com.au> wrote:
> In article <7prkuq$j79$1@calais.pt.lu>,
> 	"Pletschette André" <andre.pletschette@ltam.lu> writes:
> > hi, I need a fast answer please,
> > 
> > how can I take Newline's as parameter's for the command-line to a perl
> > Script?

> It looks like your key with the "'" on it is broken. It keeps
> activating itself in places where it shouldn't.

<loss of temper>

Oh come on, use your brain. The first poster is called Andre Pletschette and
is posting from .lu domain. Now, about 4 seconds thought will suggest to you
that MAYBE JUST MAYBE English isn't his native language, so PERHAPS making
silly little snide remarks about misplaced apostrophes MAKES YOU LOOK A BIT
FOOLISH.

</loss of temper>



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

Date: Tue, 24 Aug 1999 09:23:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: someone pleae help
Message-Id: <37c563b7.5252697@news.skynet.be>

Carlos Cerna wrote:

>Guys I have never wrote a perl script I know a bit about html.My problem
>is that I need a script that would read a html page that contains a
>table (html generated) and allow me to change 6 text fields and write
>the changes back to the file.While on line,of course the script need to
>generate a form and ask the user to enter the page to be updated/change
>eg:1d.html.Then have 6 text fields to change.

One static page, apart from these 6 variables? Do you need to SAVE the
page, or send it to the browser?

I suggest the following approach, because it will be extremely easy to
get it to work properly, even for an inexperienced Perler. The problem
is that i'ts rather limited.

I suggest that you paste your HTML page in your script, using a "here
doc" syntax. Like this:

	print <<EndOfHTML;
<HTML><HEAD>This is a test</HEAD>
<BODY>
Insert your page here
</BODY></HTML>
EndOfHTML

Now, if you put

	print "Content-type: text/html\n\n";

in front of it, save and run it as a CGI script, you should see *this*
page in the browser. For *any* HTML page, you must take some
precautions, and replace every occurence of "\" with "\\", of "$" with
"\$", and of "@" with "\@". Now it should work with your page.

Now, next thing: insert the variables. You need to HTML-escape them, in
particular, replace "<" with "&lt;", and place the variable names (with
their "$" prefix) in the above HTML code. For example, if you have a
hash %form with the variable names 'name' and 'age', you can do:

	foreach (qw(name age)) {
		$form{$_} =~ s/</&lt;/g;
	}
	print <<EOT;
Your name is $form{name} and your age is $form{age}.
EOT

Saving it to a file can be done as:

	open(OUT, ">$pathtofile") or die "Can't write to file: $!\n";
	print OUT <<EOT; #...
This goes to the file!
EOT

   HTH,
   Bart.


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

Date: Tue, 24 Aug 1999 10:27:39 +0100
From: "Martin" <contact@nativetongues.com>
Subject: spider - stripping useless words
Message-Id: <7ptob4$ipu$1@gxsn.com>

Hi,

I'm writing a search engine spider which will be hosted on a site using only
around 80Mb of space and thinking ahead I'm trying to keep the resulting
database as compact as possible. Part of what the site does is reverse index
the words in each retrieved document and stores them in a database which
will ultimately take up a lot of space so thinking ahead I'd like to be able
to strip out all the useless common English words
eg: it, that, this, is, a, then, where... etc...

I'm assuming that someone somewhere has already done something similar, so
I'm asking if you'd be kind enough to send me either your own strip list or
even the code you've developed to do just that. In return I'd be more than
willing to swap my own snippets of code that may help your project(s).

Incidentally this is a non-profit project and I'm planning to make the whole
script available under the standard GNU License or something similar so long
as I can get it all debugged and stable.

Thanks in advance if you can help or even point me in the right direction.

Regards,

Martin




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

Date: Tue, 24 Aug 1999 09:43:23 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: spider - stripping useless words
Message-Id: <%Otw3.258$u07.1625@news.colt.net>

Martin <contact@nativetongues.com> wrote:
> Hi,

> I'm writing a search engine spider which will be hosted on a site using only
> around 80Mb of space and thinking ahead I'm trying to keep the resulting
> database as compact as possible. Part of what the site does is reverse index

> Thanks in advance if you can help or even point me in the right direction.

There's a Search::InvertedIndex module on CPAN that might save you a whole
ton of work. Last I looked it was very much a toolkit rather than an end
to end solution, but no doubt very helpful to someone like you.

If you are unaware of CPAN check www.perl.com/cpan and prepare to be happy.



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

Date: Tue, 24 Aug 1999 17:19:23 +0800
From: Andy <o_k@mailexcite.com>
Subject: String problem!
Message-Id: <37C2639B.BCB717F@mailexcite.com>

Hi,

I want to know how to get the size of a string in Perl?
-----------------------------------------------------
e.g.
$test="abcde";

How to know the number of characters contained
with $test?
-----------------------------------------------------
Thanks for helps!

Andy ~



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

Date: Tue, 24 Aug 1999 09:32:22 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: String problem!
Message-Id: <GEtw3.257$u07.1625@news.colt.net>

Andy <o_k@mailexcite.com> wrote:
> Hi,

> I want to know how to get the size of a string in Perl?

$stringlength = length($string);

length EXPR
length

Returns the length in characters of the value of EXPR.  If EXPR is
omitted, returns length of $_.  Note that this cannot be used on
an entire array or hash to find out how many elements these have.
For that, use scalar @array and scalar keys %hash respectively.

It's in standard docs. Check 'em out some time...



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

Date: Tue, 24 Aug 1999 08:39:11 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: testing
Message-Id: <PSsw3.252$u07.1811@news.colt.net>

Abigail <abigail@delanet.com> wrote:
> Nick Lee (leenick@interchange.ubc.ca) wrote on MMCLXXXIII September
> MCMXCIII in <URL:news:37C1788C.23898A5E@interchange.ubc.ca>:
> @@ sorry for any inconvenience

> *ploink*



> Abigail
> -- 
> sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
> "$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
> *_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
> _::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----

<news flash>

This just in. An internet use posted a test message to the wrong newsgroup
today, containing one line of text, that apologised for the inconvenience.

News group regular Abigail was quick to respond with a post that contained
2 lines of attribution and 11 lines of signature. The content of the message
appears to have been the word '*ploink*'

Local resident Jon Peterson then joined in by continuing the infantile off 
topic foolishness in the form of a fake press release, which he attempted to
justify on the grounds of humour. He later admitted to journalists that
this was in hindsight a hopeless losing battle and he'd stop now.

</news flash>



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

Date: Tue, 24 Aug 1999 10:22:55 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: The logic of curly braces
Message-Id: <37c26808.4422281@news.hydro.co.uk>

A keyboard was whacked upside John Doe's head and out came:

[ stuff about casting references snipped ]

>But before that, here are some examples of what I'm talking about...
>
>$apple = "red";
>$orange = "orange";
>$pare = "green";
>
>$one = "apple";
>$two = "orange";
>$three = "pare";
>
>print "${${one}}"; # is same as ${$one} = ${$one} = ${apple} = $apple = red
>print "${$one}"; # is same as ${apple} = $apple = red
>print "${one}"; # is same as ${one} = $one = apple
>
>confused?

Well you should be, because this is very wrong. If this script had
actually been run (with 'use strict') then you would have got
something along the lines of:

#!/usr/local/bin/perl -w

use strict;

my $apple = "red";
my $orange = "orange";
my $pare = "green";

my $one = "apple";
my $two = "orange";
my $three = "pare";

print "${${one}}"; # is same as ${$one} = ${$one} = ${apple} = $apple
= red
print "${$one}"; # is same as ${apple} = $apple = red
print "${one}"; # is same as ${one} = $one = apple

phys-nhhdasrvr:nhhdaba> test.pl
Can't use string ("apple") as a SCALAR ref while "strict refs" in use
at test.pl line 13.

The 3 'print' lines have misleading comments. They should probably
read

print "${${one}}"; # is same as ${$one} = ${'apple'} = nonsense
print "${$one}"; # is same as ${'apple'} = nonsense
print "${one}"; # is same as ${one} = $one = 'apple'

You would have to get very lucky indeed if you wanted to dereference
the string 'apple'.

Here's the way it works: 'one' (in this context) is a name and a
reference to a data held at some location. $one and ${one} are
identical scalar variables (a variable is a name, a type, an address
[aka a reference], and data). $ or ${} are dereferencing operators,
meaning they take a name with an address in memory and give meaning to
the data there, matching the name 'one', the address associated with
it and the data held at that location in memory with the scalar type,
giving you a variable.

>First, is $var the same as ${var}? Is there a rationale for using one
>over the other?

Yes they are. $ grabs all the name it can when it's being parsed. So,
if you have:

  #!/usr/local/bin/perl -w

  use strict;

  my $foo = 1;
  my $foobar = 2;
  my $bar = 3;
                          # Prints:
  print "$foo\n";         # 1
  print "$foobar\n";      # 2
  print "${foo}\n";       # 1
  print "${foobar}\n";    # 2
  print "${foo}bar\n";    # 1bar
  print "$foo$bar\n";     # 13

I hope that helps a little. Read perlvar and perlref. Over and over.

Gary
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: Tue, 24 Aug 1999 07:54:38 GMT
From: steveeq1@earthlink.net
Subject: The Perl debugger
Message-Id: <7ptj3q$hv2$1@nnrp1.deja.com>

Ok everyone.

Forgive me for asking such a stoopid question, but I have three
questions about the Perl debugger:

1) once I set the breakpoint. How do I tell Perl to "run through the
rest of the lines without prompting until the breakpoint. Then stop and
prompt."

2) Let's say I find a line that I want to change in Perl while the
debugger is running. Can I open it in Emacs and change it there real
time and have the debugger "know" I made the change?

3) Are there any good websites about the Perl debugger. I checked the
major search engines and couldn't find much (although I did find a lot
of great web sites that taught about Perl in general).


Anwyay, any assistance would be appreciated. . .

- Steve


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 24 Aug 1999 05:02:45 -0400
From: "Rodrigo Cortes" <roco3d@softhome.net>
Subject: User's Operative Sistem????
Message-Id: <Sbtw3.76$3r1.911@maule>

How i know the user's Operative Sistem with a perl script???

--
Rodrigo Cortés
ROCO3D
ICQ: 35921840
http://roco3d.cjb.net




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

Date: Tue, 24 Aug 1999 09:24:51 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: User's Operative Sistem????
Message-Id: <Dxtw3.256$u07.1625@news.colt.net>

Rodrigo Cortes <roco3d@softhome.net> wrote:
> How i know the user's Operative Sistem with a perl script???

There are several ways. To find basic information, use the variable $^O (that's
a capital o, not a zero).

Or, get the same info another way if you use the English module:
use English;
print "Running under $OSNAME\n";

But, if you are on some kind of unix, the command uname will give you more
information:

my $os = `uname -a`;

Finally, I should say that you question is answered in the FAQ - but maybe if
you don't speak English so well, reading the FAQ is quite hard? And anyway,
the FAQ doesn't mention uname.

:)



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

Date: 24 Aug 1999 10:27:43 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: User's Operative Sistem????
Message-Id: <37c2658f_1@newsread3.dircon.co.uk>

Rodrigo Cortes <roco3d@softhome.net> wrote:
> How i know the user's Operative Sistem with a perl script???
> 

The $^O special variable as described in the perlvar manpage.

/J\
-- 
"Nourishes at the root and penetrates right to the tip" - Pantene
Advertisement


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

Date: Tue, 24 Aug 1999 09:19:14 +0100
From: "Paul D.Smith" <pds@datcon.co.uk>
Subject: Where do I find h2xs?
Message-Id: <7ptkh1$mo$1@soap.pipex.net>

Help,

I can find lots of instances of the h2xs man page but no instances of the
program/script itself!  Can someone point me directly at a copy please?  I
have Activestate's Perl build 313 in both binary and source and its not
there!

Thanks,
Paul DS




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

Date: 24 Aug 1999 11:13:04 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where do I find h2xs?
Message-Id: <37c27030_1@newsread3.dircon.co.uk>

Paul D.Smith <pds@datcon.co.uk> wrote:
> Help,
> 
> I can find lots of instances of the h2xs man page but no instances of the
> program/script itself!  Can someone point me directly at a copy please?  I
> have Activestate's Perl build 313 in both binary and source and its not
> there!
> 

Well upgrade your Perl to something a little more recent - h2xs has been 
part of the Activestate distribution for all of the 500 series builds.

/J\
-- 
"Shhh! They're strapping down Liza Minelli" - Lisa Simpson


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

Date: Tue, 24 Aug 1999 10:44:07 +0100
From: Andrew Fry <andrewf@beausys.freeserve.co.uk>
Subject: Win32::OLE to read Word file
Message-Id: <IwG9JBAnlmw3Ewml@beausys.freeserve.co.uk>

Anyone have an example of a Win32:OLE program
that reads a Word file line-by-line ?
I've seen an example that prints a Word file, but
this isnt what I want to do, and it isnt obvious
how I might modify it to do what I want.

Any help or pointers appreciated. Thanks.
---
Andrew Fry
"Time flies like an arrow. Fruit flies like a banana". (Groucho Marx).


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu. 

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


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