[7914] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1539 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 27 08:07:19 1997

Date: Sat, 27 Dec 97 05:00:44 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 27 Dec 1997     Volume: 8 Number: 1539

Today's topics:
     Re: ARGV to read commandline input <Curmudgeon@mbcf.org>
     Re: Beginner question regarding single-quoted strings (Tad McClellan)
     Re: Finding the TITLE to a HTML page <Curmudgeon@mbcf.org>
     Re: Finding the TITLE to a HTML page <webmaster@hsv.com.au>
     Re: Finding the TITLE to a HTML page (perl -e "warn unpack 'u*','5<V%M=65L;$!C:7,N=6%B+F5D=0T*';")
     Re: Finding the TITLE to a HTML page <ljz@ljz.asfast.net>
     Help, "Fatal error" 'libperl.a' when compiling Perl 5.0 <alexandera@earthlink.net>
     Re: Help, "Fatal error" 'libperl.a' when compiling Perl <mshill@ridgecrest.ca.us>
     Re: How do I pass objects from Perl to Javascript? snailgem@aol.com
     How do I send an FTP line command with Win32:Internet <me@here.com>
     Re: How would you do this... (John C. Randolph)
     Re: Listing files on your server as scalar values. (Jerry Lineberry)
     Re: overloading in function (correction) <xah@best.com>
     overloading in function <xah@best.com>
     Perl Converter for Solaris version (~{Mu1~Hp~})
     Perl doc in .HLP format? <patrick.philippot@hol.fr>
     Re: Perl editor needed (Lars Kristensson)
     Re: perl on a mac? (John Moreno)
     Re: Perl5 On IIS4.0 <webmaster@hsv.com.au>
     Re: Perl5 On IIS4.0 <webmaster@hsv.com.au>
     POST in right order (Robert)
     Re: POST in right order (brian d foy)
     Script runs properly on server, but not from client <me@here.com>
     Re: setuid question (brian d foy)
     Re: Win 95 glitch with PERL 32 <webmaster@hsv.com.au>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 26 Dec 1997 18:28:29 -0800
From: Curmudgeon <Curmudgeon@mbcf.org>
To: Ted Fiedler <budo@news.ncx.com>
Subject: Re: ARGV to read commandline input
Message-Id: <34A467CD.DEE12966@mbcf.org>

I would suggest the following corrections to your code:

open(FILE, "$ARGV[0]" ) or die "Can't open file : $ARGV[0]\n";
while (<FILE>) {
	if ( /$ARGV[1]/ ) {
		print $_;
	}
}
close(<ARGV>);

I would also reccomend that you check to see if the appropriate number
command line arguments were given.  Maybe you would also like to be able
to give more than one search param on the command line.

You also have a couple modules that can help you parse the command line,
Getopt and Getopt::Long (personally I prefer using Long, it make the
comamnd line less cryptic).

Hope this helps,
/C

Ted Fiedler wrote:
> 
> #!/usr/bin/perl
> open (ARGV, $ARGV);
> while  (<$ARGV[0]>)  {
>         if (/$ARGV[1]/) {
>                 print $_;
>         }
> }
> close(ARGV);
> 
> ok im using perl 5.003 i want this program to take two commandline arguments
> then use the first as the file name and the second as the pattern match
> im pretty new and suck at regular expressions/pattern matching...
> what am i doing wrong?
> 
>                                            thanks in advance
>                                             ted


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

Date: Fri, 26 Dec 1997 19:07:17 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Beginner question regarding single-quoted strings
Message-Id: <5ck186.np.ln@localhost>

Devin Ganger (devin@premier1.net) wrote:

: Now that I've finally gotten some time to teach myself Perl, have gotten
: my employer to buy the latest versions of the O'Reilly Perl books for me,
: and have actually cracked the cover of _Learning Perl_, I have one
: question so far:

: In the examples given for single-quoted strings, 


A page number would have been helpful.


: we have the following
: text and examples:

: 	...Two exceptions: to get a single quote into a single-quoted string,
: 	precede it by a backslash.  And to get a backslash into a single-
: 	quoted string, precede the backslash by a backslash...

: 	'silly\\me' # silly, followed by backslash, followed by me
: 	'hello\n'   # hello followed by backslash followed by n

: Perhaps I'm missing some subtle nuance here, but wouldn't 'silly\me' and
: 'silly\\me' do the exact same thing in this case?


We could try it and see ;-)

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

$silly1 = 'silly\me';   # one backslash
$silly2 = 'silly\\me';  # two backslashes (one of them is redundant)

print "silly1 ==>$silly1<==\n";
print "silly2 ==>$silly2<==\n";
--------------------

outputs:

silly1 ==>silly\me<==
silly2 ==>silly\me<==



: What am I missing?


The part in parenthesis, I think:

  "(Only when the backslash is followed by another backslash or a
    single quote does it have special meaning.)"

So, every backslash is a literal backslash character unless it is
followed by one of those two characters.


In single quoted strings, you usually only need to escape backslashes if:

1) you want more that one consecutive backslash in your string
   or
2) you want a backslash at the end of a string (eg: 'sillyme\\')


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 26 Dec 1997 18:46:42 -0800
From: Curmudgeon <Curmudgeon@mbcf.org>
To: psullivan <psullivan@stlnet.com>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <34A46C12.B274CC9D@mbcf.org>

The code below seems to work fine for me.  The only thing I can think of
is that maybe your $htmlfile variable is empty so the @html array
doesn't contain anything in the first place.

Hope that helps,
/C

psullivan wrote:
> 
> How would I find the title from a html file? I tried...
> 
> open(HTML,$htmlfile);
> @html = <HTML>;
> close(HTML);
> 
> foreach $line (@html) {
>         if ($line =~ /title/i) {
>                 $html_title = $line;
>         }
> }
> 
> and then I would take out the <title> and </title> tags, but it returns a
> blank $html_line variable. It looks fine to me, but is there another way of
> finding the title without having to resort to use calls? (i.e. the HTML::
> ones, if such one exists). I would like to keep it as portable as possible.
> Thanks.
> 
> Patrick Sullivan


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

Date: Sat, 27 Dec 1997 14:49:45 +1100
From: "Andrew Quested" <webmaster@hsv.com.au>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <681tqo$ago$1@news.mel.aone.net.au>

When trying to find anything in HTML, including the title, you might want to
remember that the tags may start and finish on different lines. Many people
who hand code HTML may like to use something like this...
<title>
This is the Title.
</title>

Try searching for the indexof <title>, and then searching for the indexof
</title> and then taking the substring from the start to the end, and
pulling out the tags and newlines. That will leave you with the title of the
HTML page, even if the tags are spread over a few lines.

For example

open(HTML,$htmlfile);
@html = <HTML>;
close(HTML);

$webpage="@html";
$title=substr($webpage,index($webpage,"<title>"),index($webpage,"</title"));

$title=~s/\n/ /;
$title=~s/<title>//;
$title=~s/<\/title>//;

There may be a few errors in that, but you can at least see what I'm getting
at.

Andrew Quested





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

Date: Sat, 27 Dec 1997 05:15:13 GMT
From: i@non.org (perl -e "warn unpack 'u*','5<V%M=65L;$!C:7,N=6%B+F5D=0T*';")
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <883197168.2432@207.53.4.30>


In article <681kas$t8g$2@news.stlnet.com> on Sat, 27 Dec 97 00:59:57 GMT,
 psullivan@stlnet.com (psullivan) wrote:

> How would I find the title from a html file? I tried...

> open(HTML,$htmlfile);
> @html = <HTML>;
> close(HTML);

> foreach $line (@html) {
>         if ($line =~ /title/i) {
>                 $html_title = $line;
>         }
> }

> and then I would take out the <title> and </title> tags, but it returns a 
> blank $html_line variable. It looks fine to me, but is there another way of 
> finding the title without having to resort to use calls? (i.e. the HTML:: 
> ones, if such one exists). I would like to keep it as portable as possible. 

You can take-out the tags at the same time.  You also need to be
able to pick out a title that is spread over more than one line.

As far as portability is concerned, check out the following one-liner:

perl -e "$I=join '',<>; print $1 if $I =~ /TITLE>(.+?)<\/TITLE/mi;"




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

Date: 27 Dec 1997 01:04:13 -0500
From: Lloyd Zusman <ljz@ljz.asfast.net>
Subject: Re: Finding the TITLE to a HTML page
Message-Id: <m1iusb1fvm.fsf@ljz.asfast.net>

psullivan@stlnet.com (psullivan) writes:

> How would I find the title from a html file? I tried...
> open(HTML,$htmlfile);
> @html = <HTML>;
> close(HTML);
> 
> foreach $line (@html) {
>         if ($line =~ /title/i) {
>                 $html_title = $line;
>         }
> }
> 
> and then I would take out the <title> and </title> tags, but it returns a 
> blank $html_line variable. It looks fine to me, but is there another way of 
>       ^^^^^^^^^^
> finding the title without having to resort to use calls? (i.e. the HTML:: 
> ones, if such one exists). I would like to keep it as portable as possible. 
> Thanks.

While you're waiting for someone to send you a reference to an
appropriate HTML-parsing module, I have some comments about your Perl
code:

First of all, I think that the reason your '$html_line' variable is
blank is because in your loop, you're setting a variable called
'$html_title'.

Also, here's a method for finding the title which doesn't require a
loop and which handles the case where the <title> and </title> tags
are on different lines:

  Line 1:   unless (open(HTML, "<$htmlfile")) {
  Line 2:      # error processing goes here
  Line 3:   }
  Line 4:   $html = join('', <HTML>);
  Line 5:   close(HTML);
  Line 6:   if ($html =~ m/<title>(.*?)</title>/is) {
  Line 7:      $html_title = $1;
  Line 8:   }
  Line 9:   # more error processing goes here

The statement on Line 3 reads the entire HTML file into one scalar
variable.

The regular expression on Line 6 terminates with an 's'.  This 's'
causes the '.' in the regular expression to match newlines as well as
other characters ... in other words, the matching will be performed
properly even when the searched-for pattern spans multiple lines.  The
'?' in this reqular expression causes '.*' to match the *shortest*
string that fits between a <title> and a </title> tag.  This will
handle the (admittedly erroneous) case where there are mutiple <title>
or </title> tags in the document.

Finally, the parentheses in the regular expression cause the string
matched by '.*?' to be put into the variable $1.  Therefore the
'$html_title' variable will be set to everything between the <title>
and the </title> tags.

However, you're better off using a bona fide HTML parser, since there
are a number of cases where this kind of pattern matching will fail to
return a proper title.  Therefore, I agree that a pre-existing module
will help you.  I think that such an HTML parser exists somewhere in
the LWP:: module, but someone more familiar with that package will
have to confirm this.

-- 
 Lloyd Zusman
 ljz@asfast.com


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

Date: Fri, 26 Dec 1997 21:39:51 +0000
From: Ames <alexandera@earthlink.net>
Subject: Help, "Fatal error" 'libperl.a' when compiling Perl 5.004_04
Message-Id: <34A42415.FC5C71A9@earthlink.net>

I have recently tried compiling Perl 5.004 but have run into the
following snag:

 ........
rm -f libperl.a
ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o
pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o globals.o
perlio.o
sh: ar: not found
*** Error code 1
make: Fatal error: Command failed for target `libperl.a'
# pwd
/home/aalexand/downloads/perl5.004_04


"sh: ar: not found"  -> whats this all about??

any suggestions?

-Ames



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

Date: Fri, 26 Dec 1997 23:48:59 -0800
From: "Mike Hill" <mshill@ridgecrest.ca.us>
Subject: Re: Help, "Fatal error" 'libperl.a' when compiling Perl 5.004_04
Message-Id: <682c2u$215$1@ash.ridgecrest.ca.us>

You need to include the path to the archiving program 'ar' in your path
before using make.
sh (bourne shell) is telling you that it can't find the program 'ar'
usually found in the following directories:
/usr/bin
/usr/xpg4/bin

Hope this helps.

Ames wrote in message <34A42415.FC5C71A9@earthlink.net>...
>I have recently tried compiling Perl 5.004 but have run into the
>following snag:
>
>........
>rm -f libperl.a
>ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
>dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o
>pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o globals.o
>perlio.o
>sh: ar: not found
>*** Error code 1
>make: Fatal error: Command failed for target `libperl.a'
># pwd
>/home/aalexand/downloads/perl5.004_04
>
>
>"sh: ar: not found"  -> whats this all about??
>
>any suggestions?
>
>-Ames
>




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

Date: Fri, 26 Dec 1997 21:58:38 -0500
From: snailgem@aol.com
Subject: Re: How do I pass objects from Perl to Javascript?
Message-Id: <34A46EDE.7A60@aol.com>

Let me ask the opposite question: is there any way to pass a JS
generated page (say the content of a page generated by a call to 
window.open from another page) to Perl? Given the fact that this happens
on the client, the answer is probably: 'no way', but I'm willing to
learn otherwise).

Thanks.

P.S. Yes, I know, I should ask this in the JS or CGI newsgroups. I did,
and got no replies.

Will
-----

Tushar Samant wrote:
> 
> spectd@horus.sara.nl writes:
> >I am creating nascent documents from a textbase created using CGI.pm
> >and wish to transfer the data to Javascript objects in an efficient
> >way. Does anyone have any suggestions?
> >
> >I am doing it in a very long-winded fashion at the moment by creating
> >text strings in Perl which replace placeholders in my html document.
> >This is fine for a limited application, but I would like to do it in a
> >more general way by passing a CGI.pm object to the Javascript.
> 
> Maybe I don't understand the situation, but what's long-winded about
> this? CGI.pm implements a Perl class, it IS Perl's job to present it
> to someone else. Can Javascript manipulate a Perl object's storage
> format better than Perl? I doubt it.
> 
> More generally, if you want to send an object over to N**tscape who
> does his Javascript thing -- you will anyway have to represent it
> textually somehow. Someone has to work for a functioning interchange;
> so who should bear the bigger responsibility? I don't think there is
> a dilemma there -- it's whoever has superior textual powers -- Perl,
> hands down...
> 
> The mewling runt gets the bigger portion -- Javascript should be given
> the easier job. Perl should go so far as to emit Javascript code ready
> to be sourced by N**scape or whoever...
> 
> Maybe you are talking about creating more compact Javascript source --
> you have to ask why that's preferable to just a sequence of assignments.


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

Date: Sat, 27 Dec 1997 04:10:12 -0500
From: me <me@here.com>
Subject: How do I send an FTP line command with Win32:Internet
Message-Id: <34A4C5F4.5ABAF154@here.com>

I have the need to issue the command "quote site filetype=jes" before I
"put" my file.  Is there a way to issue this command with
Win32:Internet?  Other suggestions are also welcome.  I am on an Intel
box running IIS3.0.  Thank you.

Alan Sturm
alan@globalec.com






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

Date: 27 Dec 1997 10:23:41 GMT
From: jcr.remove@this.phrase.idiom.com (John C. Randolph)
Subject: Re: How would you do this...
Message-Id: <682kvd$k7d$2@news.idiom.com>

In <681a4r$1f5$1@news2.cais.com> "Sorrow" wrote:
-> I'm running a perl script on a text file where each line
-> looks like this:
-> 
-> LINENUM=DATA1 <space> DATA2 <space> DATA3 <newline>
-> 
-> and what it is supposed to do is sort the information
-> in the original text file based on DATA2 and write it
-> out to a new, sorted, text file.
-> The following is what I came up with.
-> I'm very new to perl and I'm certain that I am doing
-> things the hard way.  By seeing how any of you would
-> have done this task, it lets me learn from my mistakes.
-> 
-> while(<>) {
->   s/[^\.]+=//;
->   @info = split( /\s/, $_ );
->   if( $info[1] == 1 ) {
->     push( @goodlist, join( ' ', $info[0], $info[1], $info[2] ));
->   } else {
->     push( @badlist, join( ' ', $info[0], $info[1], $info[2] ));
->   }
-> }
-> open( OUTFILE, ">nbsort.txt" ) || die( $! );
-> foreach $infoline (@goodlist) {
->   print OUTFILE "$infoline\n";
-> }
-> foreach $infoline (@badlist) {
->   print OUTFILE "$infoline\n";
-> }
-> close( OUTFILE );
-> 
-> 
-> Thank you for your help and your insight.
-> 
-> Chris

Perl has a sort function.  The sort function has a form : 

sort <subroutineName> list  

That you can use to sort on whatever criteria you like.

The comparison routine is passed two variables, $a and $b, and your routine 
should return -1, 0 or 1, depending on whether $a should precede $b, $b and 
$a are equivalent for sorting purposes, or $b should precede $a.

$a and $b will be passed by reference, so don't modify them.

So, for your specific problem, I'd suggest something like:

#!/usr/bin/perl
@lines = <>;

sort bySecondToken @lines;

print @lines;

sub bySecondToken
{
my @aParts;
my @bParts;
@aParts = split ($a);
@bParts = split ($b);
return $aParts[1] <=> $bParts [1];
}

If you get the Camel Book, check out the examples on page 218.
--
John C. Randolph (408) 358-6732  NeXT mail preferred.
Chief Technology Officer, WARPnet Incorporated.
@"Hey, %s! You're a NAZI, and you can't spell!"



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

Date: Sat, 27 Dec 1997 04:01:09 -0600
From: jerryl@connecti.com (Jerry Lineberry)
Subject: Re: Listing files on your server as scalar values.
Message-Id: <883058740.1234501637@dejanews.com>

In article <mf3p76.kh2.ln@localhost>,
  tadmc@metronet.com (Tad McClellan) wrote:
>
> lineberry@cyberdude.com wrote:
> : In article <comdog-ya02408000R0912971543420001@news.panix.com>,
> :   comdog@computerdog.com (brian d foy) wrote:
>
> [snip]
>
> : > you might want to consider use of the directory reading family of
> : > functions: opendir, readdir, and so on, along with the file test
> : > operators.
>
> [snip]
>
> : Thanks,  Using the "directory functions" would be a better way of doing
> : my task. Here's the problem I encounter when using "opendir". Everything
> : works fine when I use the DIRHANDLE "THISDIR" but if I try to go one
> : directory up ".." some of the directories are not listed as directories.
> : And if I try to use the -f for "ascii text" files; they do not get
> : listed. However, all the remaining files and directories are printed as
> : BLAH:.
>
> : #!/usr/bin/perl -w
>
> : open(OUTPUT, ">dirp") or die "What's wrong with dirp? = : $!";
>
> : opendir THISDIR, "." or die "Major Problem #1: $!"; @allfiles = readdir
> : THISDIR; foreach $file (@allfiles) {if (-d "$file") {print OUTPUT
> : "Directory: $file\n"} else {print OUTPUT "BLAH: $file\n"}} closedir
> : THISDIR;
>
> : opendir ROOT, ".." or die "Something's wrong! = : $!"; @rootdir = readdir
> : ROOT; foreach $file (@rootdir) {if (-d "$file") {print OUTPUT "Directory:
>                                      ^^^^^^^^^^^^
>
>    (-d "../$file")
>
> I don't see how you could have missed this in the 'perlfunc'
> description of the function that you are using:
>
> ---------------------------
> =item readdir DIRHANDLE
>
> Returns the next directory entry for a directory opened by opendir().
> If used in a list context, returns all the rest of the entries in the
> directory.  If there are no more entries, returns an undefined value in
> a scalar context or a null list in a list context.
>
> If you're planning to filetest the return values out of a readdir(), you'd
> better prepend the directory in question.  Otherwise, because we didn't
> chdir() there, it would have been testing the wrong file.
>
>     opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
>     @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR);
>     closedir DIR;
> ---------------------------
>
> : Any suggestions?
>
> 1) read about functions that you want to use in the documentation that
>    came with perl.
>
> 2) Format your code so that a human can read it too...


I did look at the perlfunc man, but I did not completely understand it.

Also, I apoligize for the file being unreadable. When I loaded the file
to Dejanews, the lines were not merged. I'll have to figure out why this
happened. I don't use the TABs on loops because, I've seen other people
not use them and I like that style.

-Jerry

>
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Sat, 27 Dec 1997 00:40:21 -0800
From: "Xah" <xah@best.com>
Subject: Re: overloading in function (correction)
Message-Id: <682eku$rjv$3@nntp1.ba.best.com>

Here's a correction to the Mathematica code I gave:

range[a_]:=range[1,a,1];
range[a_,b_]:=range[a,b,1];
range[a_,b_,dx_]/;(Sign@N@(b-a)===Sign@N@dx):=Prepend[range[a+dx,b,dx],a];

 Xah, xah@best.com
 http://www.best.com/~xah/Wallpaper_dir/c0_WallPaper.html
 "Unix + C + Perl = Apocalypse"



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

Date: Sat, 27 Dec 1997 00:33:04 -0800
From: "Xah" <xah@best.com>
Subject: overloading in function
Message-Id: <682e79$rjv$2@nntp1.ba.best.com>

How can I write a function so that its behavior depends on the number of
arguments?

For example, here's a function called 'range' written in Mathematica.
(implemented without error checking)

range::"usage"=
  "range[a,b,dx] returns a list from a to b with increment dx. dx can be
negative if a > b. range[n] is equivalent to range[1,n,1]. range[a,b] is
equivalent to range[a,b,1].";

range[a_]:=range[1,a,1];
range[a_,b_]:=range[a,b,1];
range[a_,b_,dx_]:=Prepend[range[a+dx,b,dx],a];

I want to write range in both Perl and Scheme. Suggestion of common practice
appreciated. (if it cannot be done as is)

 Xah, xah@best.com
 http://www.best.com/~xah/Wallpaper_dir/c0_WallPaper.html
 "Unix + C + Perl = Apocalypse"


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

Date: 27 Dec 1997 08:44:10 GMT
From: isc40322@leonis.nus.sg (~{Mu1~Hp~})
Subject: Perl Converter for Solaris version
Message-Id: <682f4q$gua@nuscc.nus.sg>

Hi, is there any product that convert Perl scripts into the executable under 
Solaris version? Alternatively, a translator that generates C/C++ source 
codes taking Perl script as input is also welcomed.

--


*********  Wang Hao             
*********  wanghao@iscs.nus.sg 
*********  Department of Information Systems and Computer Science 
*********  National University of Singapore 
*********  Home Page  http://www.iscs.nus.sg/~wanghao  


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

Date: 27 Dec 1997 11:58:02 GMT
From: "Patrick Philippot" <patrick.philippot@hol.fr>
Subject: Perl doc in .HLP format?
Message-Id: <01bd12be$ab09e300$02000001@mainsoft>

Is there any .HLP version of the perl documentation available?
 
Thanks in advance.

-- 

Patrick Philippot

-pp (MainSoft sarl)
------------------------------------

patrick.philippot@hol.fr
Compuserve: mainsoft / mainsoft@compuserve.com
http://ourworld.compuserve.com/homepages/mainsoft
tel/fax: +33 (0)1 69 40 94 85



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

Date: 27 Dec 97 06:52:41 GMT
From: lk@dorin.com (Lars Kristensson)
Subject: Re: Perl editor needed
Message-Id: <34a4a5b9.0@d2o62.telia.com>

I have to mention QEdit for DOS. I have a faint feeling it has changed
name since I last used it but anyway, It's really a killer! 

In article
<34a18b62.22859566@news.ntslink.net>,
	dgrove@ntslink.net (David Grove) writes:
> Buy codewright. vi isn't as good as DOS Edit, which sucks. If you WANT
> a real programming editor, get one: don't settle for a re-named,
> scaled-down notepad with extra buttons.
> 
> 
> On Wed, 24 Dec 1997 01:35:09 GMT, wjin@cs.uh.edu (Woody Jin) wrote:
> 
>>In article <67mgu3$cs5$3@mainsrv.main.nc.us>, scott@softbase.com wrote:
>>>Perl editors under Windows ... 
>>
>>Elvis 2.1
>> 1) First, it is a vi.  I can't live without it
>> 2) Nice syntax coloring.
>>
>>available ftp://ftp.cs.pdx.edu/pub/elvis
>>
>>--
>>Woody
> 

-- 
-- lars.kristensson@ne.su.se, Dept of Economics, Stockholm Univ
Tel:+46-8-16 31 13, Fax:+46-8-15 94 82, Mob:+46-70-667 62 63

"As a sysadmin, YES, I CAN read Your e-mail, but I would never 
be so bored that I would."


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

Date: Fri, 26 Dec 1997 20:59:32 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: perl on a mac?
Message-Id: <1d1vz6h.o0p3nj1rvuza6N@roxboro-170.interpath.net>

Chris <goatholl@sonic.net> wrote:

> How do I get ahold of a program to run and compile perl on a macintosh?
> (performa 630cd) I want to learn how to use perl to write simple cgi
> scripts to use with web pages, where do I start???

MacPerl => <http://www.ptf.com/macperl/>

-- 
John Moreno


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

Date: Sat, 27 Dec 1997 15:02:49 +1100
From: "Andrew Quested" <webmaster@hsv.com.au>
Subject: Re: Perl5 On IIS4.0
Message-Id: <681uj7$dvr$1@news.mel.aone.net.au>

>Anyone had success running Perl on NT 4.0?


Yes, I have got Perl running on NT4, however, I am still at IIS 3. If IIS 4
is anything like the pervious version, you will find a section in the online
docs that explains how to set up associations for different scripting
languages.

It was under this heading in IIS 3:




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

Date: Sat, 27 Dec 1997 15:03:50 +1100
From: "Andrew Quested" <webmaster@hsv.com.au>
Subject: Re: Perl5 On IIS4.0
Message-Id: <681ul5$edi$1@news.mel.aone.net.au>


Sorry... it was under this heading in IIS 3...

Associating Interpreters with Applications (Script Mapping)

- AQ




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

Date: Sat, 27 Dec 1997 02:50:49 GMT
From: rv@algonet.se (Robert)
Subject: POST in right order
Message-Id: <34a46822.226476@news.algonet.se>

Is there any way to get the HTML form-tag to post the containts of the
page in the right order? If not, how can I solve this:

I have a script that creates a form based upon the current day. Info
for the form is taken from a textfile. All of this info can be altered
in a textbox that resides next to the line.

$line <input type=\"text\" width=30 name=\"info$nr\">
where $line is the string from the textfile.

To keep track of which line (in the textfile) $line is, I have $nr.
These data is also posted from the creating script. I figured that the
best method of getting these data back to the main script would be by
passing them through the 'hidden' type.

$line <input type=\"text\" width=30 name=\"info$nr\"><input
type=\"hidden\" value=$nr>

But the darn form won't pass my data back in the right order :(

The amount of data ($line:s) is different every day...

Is there a way to clear this mess up? I guess comparing the actual
name of the variable is impossible...

/Robert


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

Date: Sat, 27 Dec 1997 07:31:44 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: POST in right order
Message-Id: <comdog-2712970731440001@news.panix.com>

In article <34a46822.226476@news.algonet.se>, rv@algonet.se wrote:

 
> But the darn form won't pass my data back in the right order :(

it's not required to pass it in any order.

> The amount of data ($line:s) is different every day...
> 
> Is there a way to clear this mess up? I guess comparing the actual
> name of the variable is impossible...

using a standard library such as CGI.pm and flexible coding 
techniques will allow you to use the data in any order that they
are passed.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Sat, 27 Dec 1997 04:17:09 -0500
From: me <me@here.com>
Subject: Script runs properly on server, but not from client
Message-Id: <34A4C794.35B02A94@here.com>

I'm using Win32:Service to attempt to list all the services on a remote
system (stop/start features will be added later) to a web client via
HTML.
What is happening is that if I run the script from the browser
physically
located on the webserver, it lists them out fine.  However if I run it
from
the browser on my workstation I get only the table headings, no services
info.

Code Segment:
print "<table border>";
print "<th>Service Name / Status
Name</th><th>Status</th><th>Action</th>";
Win32::Service::GetServices($hostname, \%services);
foreach $key (sort keys %services){
  print "<tr><td><b>$key, $services{$key}</b></td>";
  Win32::Service::GetStatus($hostname,$services{$key},\%status);
  $stat = $status{'CurrentState'};
  $name = $services{$key}; .................and so on.........

The server and workstation are logged into the same NT domain as the
same user.

I get the same result using Win32::InitiateSystemShutdown.  When run
from the webserver I can reboot another system, but from my workstation
it fails.

Help!!  Thanks.

Alan Sturm
alan@globalec.com
Sterling Commerce






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

Date: Sat, 27 Dec 1997 07:29:36 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: setuid question
Message-Id: <comdog-2712970729360001@news.panix.com>

In article <LjLfIuAX0Fp0Ewzi@worsdall.demon.co.uk>, Mark Worsdall <shadowweb@worsdall.demon.co.uk> wrote:

> >   * when calling the shell, you should probably use the full path
> >   to executables.  imagine someone munging the PATH and getting some
> >   other nslookup to run!  i always set $ENV{'PATH'} = '' in any setuid
> >   scripts.
> >
> Do you always set $ENV{'PATH'} = '' before you call anything, ie.
> external program or r/w datafile, or do you just do this once in the
> script?

once you change the value of the data associated with a hash key, it
stays that way until you change it again.  unless you have something 
really wierd happening, you should only need to do it once.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Sat, 27 Dec 1997 14:57:00 +1100
From: "Andrew Quested" <webmaster@hsv.com.au>
Subject: Re: Win 95 glitch with PERL 32
Message-Id: <681u8c$ci6$1@news.mel.aone.net.au>

>@array = <STDIN>;
>print (@array);
>print ("hello\n");
>print (@array);
>
>This code skips printing the first element of the @array the first
>time print(@array); is executed.  The second print(@array); prints
>every element properly.  The conclusion is that the array is read
>properly but that ctrl-z causes Windows 95 to skip the next line of
>code.
>
>Others have confirmed that it is not "build" specific.  Seems to be a
>Win 95 problem.



I tried it on Win NT 4, Perl 5.004_02 and your code works fine.

Andrew Q.




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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1539
**************************************

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