[16424] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3836 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 28 18:10:35 2000

Date: Fri, 28 Jul 2000 15:10:23 -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: <964822223-v9-i3836@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 28 Jul 2000     Volume: 9 Number: 3836

Today's topics:
    Re: I need a magic spell! (Csaba Raduly)
        I need help <nikitta@ica.net>
        I need help <nikitta@ica.net>
        I need help <nikitta@ica.net>
    Re: I need help <lr@hpl.hp.com>
    Re: I need help <lauren_smith13@hotmail.com>
    Re: I need help <lr@hpl.hp.com>
    Re: Is "exit()" necessary? (BUCK NAKED1)
    Re: Linked list etc. <makarand_kulkarni@my-deja.com>
    Re: Linked list etc. <bart.lateur@skynet.be>
    Re: Linked list etc. (Logan Shaw)
    Re: Linux, Perl and parallelport <Jonathan.L.Ericson@jpl.nasa.gov>
    Re: Making and extracting from XML-like string (Abigail)
    Re: Making and extracting from XML-like string <bart.lateur@skynet.be>
    Re: Need to change @INC <etienno@my-deja.com>
    Re: Need to change @INC <etienno@my-deja.com>
    Re: newb q - help with write to file script <toyboy@toy.eyep.net>
    Re: newb q - help with write to file script <lr@hpl.hp.com>
    Re: newb q - help with write to file script (Eric Bohlman)
    Re: newb Q, Our perl guy left!! (Bruce Salem)
    Re: newb Q, Our perl guy left!! <flavell@mail.cern.ch>
    Re: newb Q, Our perl guy left!! <toyboy@toy.eyep.net>
    Re: newb Q, Our perl guy left!! (NP)
    Re: password unix with crypt <zhamm@nc.rr.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 28 Jul 2000 19:19:26 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: I need a magic spell!
Message-Id: <8F7FCDFC2quuxi@194.203.134.200>

28 Jul 2000: A formal bug report was sent to Seti@Home, because the
following message originated from whatasite@geocities.com (Kevin) was
reported as containing signs of intelligence: 

>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 5.00.2615.200
>X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200

This leads me to believe you're lacking tar, so see below

[snip]
>
>Does anyone have an easy and exact perl script to clone the contents
>of one directory to another?
>
>I just want to copy a directory using perl or even perphaps the
>file::copy module.
>
>

perl -e "system( qq(xcopy *.* c:\\temp /s) )"

-- 
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com      http://www.sophos.com/
US Support +1 888 SOPHOS 9      UK Support +44 1235 559933
Life is complex, with real and imaginary parts.


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

Date: Fri, 28 Jul 2000 16:06:03 -0700
From: nikita <nikitta@ica.net>
Subject: I need help
Message-Id: <398211DA.B74CCE89@ica.net>

Hi everybody

I going mad with this script
Can anybody please help me
the script should have given me 10 lines of information with the "Next"
button
but it gives me a sub "Error" instead.
I know there is a mistake somewhere i could find it.

Thanks in advance

 Serguei

========================================================================================

#!/usr/bin/perl -w
use CGI;
$query = new CGI;
$datafile = "/home/visualweb/html/vw/datas/data2.txt";
$main_script ="http://www.visualweb.org/cgi-bin/com/11a.cgi";
print $query->header(-type => 'text/html; charset=windows-1251');
print $query->start_html(-title=>'Catalog page');

if ($FORM{'display'} eq ""){
$FORM{'display'}=10; #10
}
if ($FORM{'num_begin'} eq ""){
$FORM{'num_begin'}=1;
}
if ($FORM{'num_end'} eq ""){
$FORM{'num_end'}=10;
}

    &parse_form; #21
    $ticker=0;

   if ($FORM{'display'}>$FORM{'num_end'}){
   $FORM{'num_end'}=$FORM{'display'};
}


   #31
    &open_file("DATAFILE","", $datafile);
     $read_file;
        $counter = 0;
         # split the fields at the | character
        @data = (/\|/, $line ,11);
    $num = $data[0];
    $one = $data[1];
    $two = $data[2];
    $line1 = $data[3];
    $line2 = $data[4]; #41
    $line3 = $data[5];
    $three = $data[6];
    $four = $data[7];
    $five = $data[8];
    $six = $data[9];
    $seven = $data[10];
      chop($seven);


#51
# begin print records
print "<center><img
src=\"http://www.visualweb.org/vw/datas/company.gif\">\n";
print "<center><h2>$title</h2>\n";


 if (($num != 0) && ($one ne " " || $two ne " ")){ #57
       $ticker++;

        if ($counter < $FORM{'num_end'}){
              $counter++;
            if ($counter>= $FORM{'num_begin'}){
              &print_data;}
         }
}

#end print records
     close(DATAFILE);
       if ($counter==0) {
         &sorry;
}

    $newbegin=($FORM{'num_end'}+1);
    $newend=$FORM{'num_end'}+$FORM{'display'};

    if ($ticker<$FORM{'num_end'}){
    $FORM{'num_end'}=$ticker;
    $switch="on";}

    if ($counter==0) {
    $FORM{'num_end'}=0;
    $FORM{'num_begin'}=0;
    $ticker=0;
    }

    print "<center><TABLE width=390 cellspacing=0 border=0>\n";
    print "<tr><td><form action=\"$main_script\" method=\"post\">\n";
    print "<input type=\"hidden\" name=\"num_begin\"
value=\"$newbegin\">\n";
    print "<input type=\"hidden\" name=\"num_end\"
value=\"$newend\">\n";
    print "<input type=\"button\" value=\"Back\" onClick=\"back()\">\n";


     if ($switch ne "on"){
    print "<input type=\"submit\" value=\"Next\">\n";}
    print " &nbsp;&nbsp;&nbsp;<font face=\"arial\"><B> found:
$FORM{'num_begin'}-$FORM{'num_end'} from
$ticker</B></form></td></tr></table>\n";
    exit;
print $query->end_html;

sub open_file {

  my ($filevar, $filemode, $datafile) = @_;

  open ($filevar,$filemode . $datafile) ||
     die ("Can't open $datafile");
}

sub read_file {

  my ($filevar) = @_;

  <$filevar>;
}

sub parse_form {
   read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
   if (length($cache) < 5) {
         $buffer = $ENV{QUERY_STRING};
    }

  @pairs = split(/&/, $cache);
   foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);

      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

      $FORM{$name} = $value;
   }
}

sub print_data{
       sub print _data contains  HTML code with  $num  $one  $two ......
$seven
exit;
}

sub sorry {

 print "content-type:text/html\n\n";
 print "<HEAD><title>Error!</title></head>\n";
 print "<body bgcolor=\"#fffff\">\n";
 print "<center><TABLE width=\"520\">\n";
 print "<TR><TD><H2>Error</h2></TD></TR>\n";
 print "<TR><TD><P>Error Error Error.</p></td></tr>\n";
 print "<BR><BR>\n";
 print "</TABLE></center>\n";

 print "</BODY></HTML>\n";
exit;
}





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

Date: Fri, 28 Jul 2000 16:15:20 -0700
From: nikita <nikitta@ica.net>
Subject: I need help
Message-Id: <39821407.488F60E7@ica.net>

Hi everybody

I going mad with this script
Can anybody please help me
the script should have given me 10 lines of information with the "Next"
button
but it gives me a sub "Error" instead.
I know there is a mistake somewhere i could find it.

Thanks in advance

 Serguei

========================================================================================

#!/usr/bin/perl -w
use CGI;
$query = new CGI;
$datafile = "/home/visualweb/html/vw/datas/data2.txt";
$main_script ="http://www.visualweb.org/cgi-bin/com/11a.cgi";
print $query->header(-type => 'text/html; charset=windows-1251');
print $query->start_html(-title=>'Catalog page');

if ($FORM{'display'} eq ""){
$FORM{'display'}=10; #10
}
if ($FORM{'num_begin'} eq ""){
$FORM{'num_begin'}=1;
}
if ($FORM{'num_end'} eq ""){
$FORM{'num_end'}=10;
}

    &parse_form; #21
    $ticker=0;

   if ($FORM{'display'}>$FORM{'num_end'}){
   $FORM{'num_end'}=$FORM{'display'};
}


   #31
    &open_file("DATAFILE","", $datafile);
     $read_file;
        $counter = 0;
         # split the fields at the | character
        @data = (/\|/, $line ,11);
    $num = $data[0];
    $one = $data[1];
    $two = $data[2];
    $line1 = $data[3];
    $line2 = $data[4]; #41
    $line3 = $data[5];
    $three = $data[6];
    $four = $data[7];
    $five = $data[8];
    $six = $data[9];
    $seven = $data[10];
      chop($seven);


#51
# begin print records
print "<center><img
src=\"http://www.visualweb.org/vw/datas/company.gif\">\n";
print "<center><h2>$title</h2>\n";


 if (($num != 0) && ($one ne " " || $two ne " ")){ #57
       $ticker++;

        if ($counter < $FORM{'num_end'}){
              $counter++;
            if ($counter>= $FORM{'num_begin'}){
              &print_data;}
         }
}

#end print records
     close(DATAFILE);
       if ($counter==0) {
         &sorry;
}

    $newbegin=($FORM{'num_end'}+1);
    $newend=$FORM{'num_end'}+$FORM{'display'};

    if ($ticker<$FORM{'num_end'}){
    $FORM{'num_end'}=$ticker;
    $switch="on";}

    if ($counter==0) {
    $FORM{'num_end'}=0;
    $FORM{'num_begin'}=0;
    $ticker=0;
    }

    print "<center><TABLE width=390 cellspacing=0 border=0>\n";
    print "<tr><td><form action=\"$main_script\" method=\"post\">\n";
    print "<input type=\"hidden\" name=\"num_begin\"
value=\"$newbegin\">\n";
    print "<input type=\"hidden\" name=\"num_end\"
value=\"$newend\">\n";
    print "<input type=\"button\" value=\"Back\" onClick=\"back()\">\n";



     if ($switch ne "on"){
    print "<input type=\"submit\" value=\"Next\">\n";}
    print " &nbsp;&nbsp;&nbsp;<font face=\"arial\"><B> found:
$FORM{'num_begin'}-$FORM{'num_end'} from
$ticker</B></form></td></tr></table>\n";
    exit;
print $query->end_html;

sub open_file {

  my ($filevar, $filemode, $datafile) = @_;

  open ($filevar,$filemode . $datafile) ||
     die ("Can't open $datafile");
}

sub read_file {

  my ($filevar) = @_;

  <$filevar>;
}

sub parse_form {
   read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
   if (length($cache) < 5) {
         $buffer = $ENV{QUERY_STRING};
    }

  @pairs = split(/&/, $cache);
   foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);

      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

      $FORM{$name} = $value;
   }
}

sub print_data{
       sub print _data contains  HTML code with  $num  $one  $two ......

$seven
exit;
}

sub sorry {

 print "content-type:text/html\n\n";
 print "<HEAD><title>Error!</title></head>\n";
 print "<body bgcolor=\"#fffff\">\n";
 print "<center><TABLE width=\"520\">\n";
 print "<TR><TD><H2>Error</h2></TD></TR>\n";
 print "<TR><TD><P>Error Error Error.</p></td></tr>\n";
 print "<BR><BR>\n";
 print "</TABLE></center>\n";

 print "</BODY></HTML>\n";
exit;
}







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

Date: Fri, 28 Jul 2000 16:44:06 -0700
From: nikita <nikitta@ica.net>
Subject: I need help
Message-Id: <39821AC6.B635E02C@ica.net>

Hi everybody

I going mad with this script
Can anybody please help me
the script should have given me 10 lines of information with the "Next"
button
but it gives me a sub "Error" instead.
I know there is a mistake somewhere i could find it.

Thanks in advance

 Serguei

========================================================================================

#!/usr/bin/perl -w
use CGI;
$query = new CGI;
$datafile = "/home/visualweb/html/vw/datas/data2.txt";
$main_script ="http://www.visualweb.org/cgi-bin/com/11a.cgi";
print $query->header(-type => 'text/html; charset=windows-1251');
print $query->start_html(-title=>'Catalog page');

if ($FORM{'display'} eq ""){
$FORM{'display'}=10; #10
}
if ($FORM{'num_begin'} eq ""){
$FORM{'num_begin'}=1;
}
if ($FORM{'num_end'} eq ""){
$FORM{'num_end'}=10;
}

    &parse_form; #21
    $ticker=0;

   if ($FORM{'display'}>$FORM{'num_end'}){
   $FORM{'num_end'}=$FORM{'display'};
}


   #31
    &open_file("DATAFILE","", $datafile);
     $read_file;
        $counter = 0;
         # split the fields at the | character
        @data = (/\|/, $line ,11);
    $num = $data[0];
    $one = $data[1];
    $two = $data[2];
    $line1 = $data[3];
    $line2 = $data[4]; #41
    $line3 = $data[5];
    $three = $data[6];
    $four = $data[7];
    $five = $data[8];
    $six = $data[9];
    $seven = $data[10];
      chop($seven);

# begin print records
print "<center><img
src=\"http://www.visualweb.org/vw/datas/company.gif\">\n";
print "<center><h2>$title</h2>\n";

if (($num != 0) && ($one ne " " || $two ne " ")){ #57
       $ticker++;

        if ($counter < $FORM{'num_end'}){
              $counter++;
            if ($counter>= $FORM{'num_begin'}){
              &print_data;}
         }
}

#end print records
     close(DATAFILE);
       if ($counter==0) {
         &sorry;
}

    $newbegin=($FORM{'num_end'}+1);
    $newend=$FORM{'num_end'}+$FORM{'display'};

    if ($ticker<$FORM{'num_end'}){
    $FORM{'num_end'}=$ticker;
    $switch="on";}

    if ($counter==0) {
    $FORM{'num_end'}=0;
    $FORM{'num_begin'}=0;
    $ticker=0;
    }

    print "<center><TABLE width=390 cellspacing=0 border=0>\n";
    print "<tr><td><form action=\"$main_script\" method=\"post\">\n";
    print "<input type=\"hidden\"
name=\"num_begin\"value=\"$newbegin\">\n";
    print "<input type=\"hidden\" name=\"num_end\"value=\"$newend\">\n";

    print "<input type=\"button\" value=\"Back\" onClick=\"back()\">\n";

     if ($switch ne "on"){
    print "<input type=\"submit\" value=\"Next\">\n";}
    print " &nbsp;&nbsp;&nbsp;<font face=\"arial\"><B> found:
$FORM{'num_begin'}-$FORM{'num_end'} from
$ticker</B></form></td></tr></table>\n";
    exit;
print $query->end_html;

sub open_file {

  my ($filevar, $filemode, $datafile) = @_;

  open ($filevar,$filemode . $datafile) ||
     die ("Can't open $datafile");
}

sub read_file {

  my ($filevar) = @_;

  <$filevar>;
}

sub parse_form {
   read(STDIN, $cache, $ENV{'CONTENT_LENGTH'});
   if (length($cache) < 5) {
         $buffer = $ENV{QUERY_STRING};
    }

  @pairs = split(/&/, $cache);
   foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);

      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

      $FORM{$name} = $value;
   }
}

sub print_data{
       sub print _data contains  HTML code with  $num  $one  $two ......

$seven
exit;
}

sub sorry {
sub_sorry contains HTML code
exit;
}







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

Date: Fri, 28 Jul 2000 13:16:56 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I need help
Message-Id: <MPG.13eb8a16a46c671498ac06@nntp.hpl.hp.com>

[Next time, please choose a more meaningful subject.]

In article <398211DA.B74CCE89@ica.net> on Fri, 28 Jul 2000 16:06:03 -
0700, nikita <nikitta@ica.net> says...

 ...

> the script should have given me 10 lines of information with the "Next"
> button
> but it gives me a sub "Error" instead.
> I know there is a mistake somewhere i could find it.

 ...

> #!/usr/bin/perl -w
> use CGI;
> $query = new CGI;

 ...

> if ($FORM{'display'} eq ""){
> $FORM{'display'}=10; #10
> }

You seem not to be aware of a primary use of CGI.pm, which is to help 
parse input parameters.  Please get rid of your home-grown parsing code, 
use the facilities of the CGI param() function, and try again.

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


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

Date: Fri, 28 Jul 2000 13:22:04 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: I need help
Message-Id: <8lspvp$uuc$1@brokaw.wa.com>


nikita <nikitta@ica.net> wrote in message news:39821407.488F60E7@ica.net...
> Hi everybody
>
> I going mad with this script
> Can anybody please help me
> the script should have given me 10 lines of information with the "Next"
> button
> but it gives me a sub "Error" instead.
> I know there is a mistake somewhere i could find it.

What was the error?

Lauren






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

Date: Fri, 28 Jul 2000 13:58:17 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I need help
Message-Id: <MPG.13eb93c54ea1516a98ac07@nntp.hpl.hp.com>

In article <39821AC6.B635E02C@ica.net> on Fri, 28 Jul 2000 16:44:06 -
0700, nikita <nikitta@ica.net> says...

Hmmm.  Three overly long posts, of varying lengths, within an hour, on 
the same problem.  What are you trying to accomplish?

No one is likely to pay attention, at this point.

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


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

Date: Fri, 28 Jul 2000 16:35:56 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Is "exit()" necessary?
Message-Id: <668-3981FCBC-6@storefull-246.iap.bryant.webtv.net>

I have a buddy in another ng who seems to know Perl a little better than
myself?; but I question his knowledge because his Perl scripts seem to
be "down and dirty" and he never uses "use strict;". 

At the end of every Perl script he writes, he puts an "exit;"... and
insists that I should do the same (even on my counter script). I
questioned him about it, and he says exit() stops any program, and
should be put at the end of all perl scripts. mmm.... okay

I can see where using "exit()" for subroutines would be useful, but I
can't really see the need to do this just because you are at the bottom
of the script you are writing. Doesn't the script terminate
automatically when it reaches the end of the script file? 

Though the perl docs do say that the "exit()" function terminates a
script, my understanding of using the "exit()" function differs from my
buddy's. The perl docs appear to state that "exit()" is used only for
expressions, thus the perl doc term "exit EXPR". 

Further, I thought the perl faq state that "exit" is similar to "die"
but that it also acts upon a preceding "END" and is mostly used for
subroutines. I'm not real clear on that part though.

So, I don't think that exit() is needed at the end of every Perl script
written. Who is correct? 

Regards,
Dennis

PS Thanks to all for the extra tips on the other here-doc printing,
truncating, etc.





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

Date: Fri, 28 Jul 2000 13:22:07 -0700
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Linked list etc.
Message-Id: <3981EB6F.68383D90@my-deja.com>

> Examples are probably
> available through the ora website somewhere.

Examples are here
http://orwant.www.media.mit.edu/algorithms-examples.html
-


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

Date: Fri, 28 Jul 2000 20:35:24 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Linked list etc.
Message-Id: <ijr3osgi92ehnnnq1cn1lfa6oeq93t9a1r@4ax.com>

Pjtg0707 wrote:

>Is there any resources on the web where I can get to to either look at some
>codes or get a module for setting up linked lists  and buffers? I've searched 
>CPAN under linked list and came up empty.

For most uses, simple Perl arrays can be used in place of a linked list.

-- 
	Bart.


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

Date: 28 Jul 2000 16:30:31 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Linked list etc.
Message-Id: <8lsu1n$shi$1@provolone.cs.utexas.edu>

In article <so2805pp3j129@corp.supernews.com>,
Pjtg0707 <Pjtg0707@netscape.net> wrote:
>The stock data I have are not just the open and closing price, but highs, 
>lows volumes and time stamps. So I have to put all the dat into multilayer
>hashes, and in correct temperal order so they can be searched and retrieved. 
>And te data don't come in sequentially. I figured I'll need linked lists for
>this sort of thing, unless someone has a suggestion for a better solution.

I have two suggestions:

  * Use an array -- they are actually quite very efficient in perl.
    Despite its name, shift() doesn't actually shift the array -- it
    just seems to update a pointer or internal index or something so
    that you have the effect of shifting without actually doing it.
    So, to emulate most of the characteristics of a linked list, you
    can just use push, pop, shift, and unshift.  If you need to store
    things in order, the arrays will still serve you well since
    inserting into an ordered array is no slower than inserting into an
    ordered linked list, and searching is faster (since you can do a
    binary search).

  * Use a SQL database.  Searching and retrieving are what you say you
    need, and that's what databases are good at.  You can then do all
    kinds of queries and tell the database to "order by" what you want.

Hope that helps.

  - Logan


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

Date: Fri, 28 Jul 2000 12:15:30 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Linux, Perl and parallelport
Message-Id: <3981DBD2.7C098D33@jpl.nasa.gov>

Jonny Snell wrote:
> I would like information how Perl can interact with the paralellport.
> With simple commands like OUT and INP as in Basic!!!
> I would like program examples as well.

'perldoc -q serial' has advice that applies to parallel ports as well.

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: 28 Jul 2000 15:20:10 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Making and extracting from XML-like string
Message-Id: <slrn8o3n6v.vcg.abigail@alexandra.foad.org>

Bart Lateur (bart.lateur@skynet.be) wrote on MMDXXIII September MCMXCIII
in <URL:news:1qh2oskin0j695ij254bfbuhl63qch80ob@4ax.com>:
,, Mark W. Schumann wrote:
,, 
,, >The thing about using regexes is that you'll have to deal with
,, >funkiness like:
,, >
,, >   <address type=email>
,, >   Fred & Barney@stonehenge.com <a couple of great guys>
,, >   </address>
,, >
,, >or
,, >
,, >   <formulation>
,, >   if x < y and y > 0 but z < 1 if and only if y > 1, then who knows?
,, >   </formulation>
,, 
,, Both are not legal XML.

Well, that ain't true. The following document validates at
validator.w3.org.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Test</title>
    </head>
    <body>
    <p>if x < y and y > 0 but z < 1 if and only if y > 1, then who knows?</p>
    </body>
    </html>

,,                         XML::Parser won't accept it. You MUST escape all
,, literal "<", "&" and ">" characters by entities ("&lt;", "&amp;" and
,, "&gt;" respectively).

Well, in that case, XML::Parser is broken.

,, XML *is* simple to parse. The only snag for doing it with regexes is
,, that tags may be split over several lines.

Yeah, sure. XML of course still has comments, attribute values, and CDATA
marked sections, things that tradionally trip naive HTML regexes. And
CDATA marked section will be more important than in HTML, as XML does
not have elements with CDATA marked content. (But that will make regexes
somewhat simpler).



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


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

Date: Fri, 28 Jul 2000 21:01:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Making and extracting from XML-like string
Message-Id: <5as3os85gfel0pm1b8q11ur09fu0ck8qaa@4ax.com>

Abigail wrote:

>,,                         XML::Parser won't accept it. You MUST escape all
>,, literal "<", "&" and ">" characters by entities ("&lt;", "&amp;" and
>,, "&gt;" respectively).
>
>Well, in that case, XML::Parser is broken.

Hmmm... I think it's a matter of DTD-based, as your example, vs.
DTD-less XML, which is what XML::Parser processes.

From the XML specification:

   All text that is not markup constitutes the character data of the
   document. The ampersand character (&) and the left angle bracket (<)
   may appear in their literal form only when used as markup delimiters,
   or within a comment, a processing instruction, or a CDATA section.

There must be something special in the XHTML specification.

I was wrong about ">". But, in ordinary XML text, bare "&" and "<" are
not allowed.

XML was designed in order to be easy to parse.

-- 
	Bart.


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

Date: Fri, 28 Jul 2000 20:40:02 GMT
From: Etienne Laverdiere <etienno@my-deja.com>
Subject: Re: Need to change @INC
Message-Id: <8lsr31$39a$1@nnrp1.deja.com>

Thanks!
-- Etienne


In article <8he1osgosnmiado11iu0v5l1e651uc9mbo@4ax.com>,
  Bart Lateur <bart.lateur@skynet.be> wrote:
> Etienne Laverdiere wrote:
>
> >Hi all, may anyone tell me How can I change the @INC? (In a NT
system?)
> >I must put this line into it:
> >
> >%INTERSHOP%\bin\perl -I %INTERSHOP% -I %INTERSHOP%\lib perlfile.pl
>
> If this is the command line, and INTERSHOP is an environment variable,
> then  it looks to me like %INTERSHOP% (the value of the environment
> variable) and %INTERSHOP%\lib (it's lib subdirectory) will be added to
> @INC. See perlrun. Does that answer your question?
>
> You can set the environment variable PERL5LIB, or PERLLIB if that's
not
> used, to these libraries. Again, see perlrun.
>
> And on a script-bvy-script basis, you can use
>
> 	use lib $ENV{INTERSHOP}, "$ENV{INTERSHOP}/lib";
>
> --
> 	Bart.
>


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


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

Date: Fri, 28 Jul 2000 20:40:23 GMT
From: Etienne Laverdiere <etienno@my-deja.com>
Subject: Re: Need to change @INC
Message-Id: <8lsr3l$3at$1@nnrp1.deja.com>

Thanks!


-- Etienne



In article <8lplsm$f854@intranews.dresdnerbank.de>,
  "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com> wrote:
>     Hi,
>
> Etienne Laverdiere schrieb in Nachricht <8lpkg2$lh4
$1@nnrp1.deja.com>...
> >Hi all, may anyone tell me How can I change the @INC? (In a NT
system?)
>
>         use lib <LIST>;
>
>     is what you need (<LIST> contains your additional pathes).
>
>     Best regards,
>
>         Peter Dintelmann
>
>


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


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

Date: Fri, 28 Jul 2000 14:49:33 -0400
From: jtoy <toyboy@toy.eyep.net>
Subject: Re: newb q - help with write to file script
Message-Id: <3981D5BD.64C1C2C8@toy.eyep.net>

that isnt very nice

Decklin Foster wrote:

> jtoy <toyboy@toy.eyep.net> writes:
>
> > shut up
>
> Please stop changing your email address; it makes it more of a chore
> to killfile you.
>
> --
> There is no TRUTH. There is no REALITY. There is no CONSISTENCY. There
> are no ABSOLUTE STATEMENTS. I'm very probably wrong. -- BSD fortune(6)



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

Date: Fri, 28 Jul 2000 11:58:33 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: newb q - help with write to file script
Message-Id: <MPG.13eb77b8314f62ec98ac03@nntp.hpl.hp.com>

In article <8ls3gm$flm$1@nnrp1.deja.com> on Fri, 28 Jul 2000 13:57:45 
GMT, pooh23@my-deja.com <pooh23@my-deja.com> says...
> I'm trying to get data from a survey form and write to a file.  I'm
> getting syntax error when I test it out on my computer at lines 8 and
> 18.  Could someone tell what syntaxical errors I may have?
> 
> CODE:
> 
> #!/usr/perl/bin -w
> use strict;

An excellent start, but there is one more line needed.  See below!

> $printmail = 'data/surveydata.dat';

How did you get this to compile using 'use strict;'?  You need 
declarations for all variables.  I think you added the 'use strict;' 
later, before posting.  :-)
 
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'})

Missing semicolon here.

> foreach split(/&/, $buffer) {            #line 8
> ($name, $value) = split(/=/, $buffer);
>  
> #maybe call function here that will parse hexidecimal

Missing closing brace here.

> open(FILE, ">>$printmail") or die "Can't open file";

The diagnostic should include $!.

> print FILE "$name";
> print FILE "\n";
> print FILE "$value";

  print $name, "\n", $value;

or

  print "$name\n$value";

or leave off the quotes around simple variables.

> close(FILE);
> }          #line 18

But none of this is relevant.  You observe the need to parse 
hexadecimal, but this is reinventing a wheel.  What you should do 
immediately is add the following to your program:

    use CGI ':standard';

and read the extensive documentation on the CGI module, which will make 
your program trivial.

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


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

Date: 28 Jul 2000 20:30:34 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: newb q - help with write to file script
Message-Id: <8lsqha$eqs$1@slb6.atl.mindspring.net>

Russ Jones (russ_jones@rac.ray.com) wrote:
: Sound like anyone we know, perl machos? When will we ever learn?

Hardly a coincidence that "jtoy" appeared the day after the Alaskan 
Electrician reappeared.



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

Date: 28 Jul 2000 18:30:29 GMT
From: bruces@canopus.Sun.COM (Bruce Salem)
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <8lsjg5$a1j$1@engnews1.eng.sun.com>

In article <3981B871.6ACF6C6B@toy.eyep.net>, jtoy  <toyboy@toy.eyep.net> wrote:
>Thank you for a more polite approach to my horrible original post,  but I am unable to
>stop this thread because of the negative posts that others and myself have posted.  I
>intend to reply to each message.  Whether this is good or bad, I don't know, but I am
>compelled at the results I got at this newsgroup.

	Please don't try to save face by attempting to answer every post. Give your
self a break and take a vacation from this group for a few hours at least and let
people forget about your thread. And learn from the experience to figure out what
people expect from others in this group. It is for perl programmers, afterall.
There is a price of entry to that group.

--
Bruce B. Salem
Sun Microsystems, Inc.
Email: bruce.salem@eng.sun.COM  
*******Standard Disclaimer*****


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

Date: Fri, 28 Jul 2000 21:22:58 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <Pine.GHP.4.21.0007282115450.17525-100000@hpplus03.cern.ch>

On 28 Jul 2000, Bruce Salem quotes the killfiled miscreant saying:

> > but I am unable to
> > stop this thread because of the negative posts that others and
> > myself have posted. 

You've only seen the tip of an iceberg.  It's a virtual certainty that
most of the people who killfiled you have remained silent about it.
The ones you have heard from were doing you a favour, even though you
don't realise it yet,

> > I intend to reply to each message. 

That's going to be distinctly counter-productive.

I would commend Bruce Salem's advice to you.  Or, as we say in this
kind of situation, "when you find yourself down a hole - stop
digging".



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

Date: Fri, 28 Jul 2000 16:42:00 -0400
From: jtoy <toyboy@toy.eyep.net>
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <3981F018.A554427@toy.eyep.net>

what is a killfile?(I really don't know)

"Alan J. Flavell" wrote:

> On 28 Jul 2000, Bruce Salem quotes the killfiled miscreant saying:
>
> > > but I am unable to
> > > stop this thread because of the negative posts that others and
> > > myself have posted.
>
> You've only seen the tip of an iceberg.  It's a virtual certainty that
> most of the people who killfiled you have remained silent about it.
> The ones you have heard from were doing you a favour, even though you
> don't realise it yet,
>
> > > I intend to reply to each message.
>
> That's going to be distinctly counter-productive.
>
> I would commend Bruce Salem's advice to you.  Or, as we say in this
> kind of situation, "when you find yourself down a hole - stop
> digging".

--
Jason Toy
toyboy@toy.eyep.net
http://toy.eyep.net




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

Date: Fri, 28 Jul 2000 21:09:58 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: newb Q, Our perl guy left!!
Message-Id: <GEmg5.388985$MB.6110688@news6.giganews.com>

On Fri, 28 Jul 2000 16:42:00 -0400, jtoy <toyboy@toy.eyep.net> wrote:
: what is a killfile?(I really don't know)

"Oh to have a killfile that could really kill." -- Unknown

-- 
Nate II



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

Date: Fri, 28 Jul 2000 16:19:47 -0400
From: Zachary Hamm <zhamm@nc.rr.com>
Subject: Re: password unix with crypt
Message-Id: <3981EAE2.9203B3C9@nc.rr.com>


Notice that none of this handles shadowed passwords.... how are they handled?

Xaq

Villy Kruse wrote:

> On Mon, 24 Jul 2000 17:13:54 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
> >Villy Kruse wrote:
> >
> >>It is actualy not strictly necessary to extract the first two
> >>characters to get the salt.  Specifying the password directly
> >>as the salt paramter would do as well.
> >
> >Not necessarily.
> >
> >For example, on my "European" FreeBSD server (MD5 encryption, because of
> >USA ban on export of "dangerous" technology),
> >
> >       crypt("Hello, world!","aa")
> >
> >returns
> >
> >       $1$aa$vCNvcZW/VEIq04KqtIeQn1
> >
> >
> >See the extra garbage at the front.
> >
>
> Yes, that "garbage" is a signal to crypt to use MD5 if passed the entire
> crypted password rather than the salt.  Thus in a system like linux
> youcan mix both traditional crypted passwords and MD5 passwords, and the
> crypt function will choose the MD5 algorithm if the salt starts with
> '$1$'.
>
> Try:
>
> crypt("Hello, world!", "$1$aa$vCNvcZW/VEIq04KqtIeQn1");
>
> If that was not so, and maybe it is not so on your system, then you
> don't realy have a portable way to extract the salt from the crypted
> password string.
>
> BTW, On my system, this example does not work in perl, but does work
> in a compiled C program.
>
> Villy



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

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


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