[9121] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2739 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 27 17:07:35 1998

Date: Wed, 27 May 98 14:01:34 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 27 May 1998     Volume: 8 Number: 2739

Today's topics:
        Password decoding... kjernigan@geocities.com
    Re: Perl for WindowsNT? (Bbirthisel)
        perl's idea of version numbers <mgregory@asc.sps.mot.com>
    Re: perl's idea of version numbers <tchrist@mox.perl.com>
    Re: perl5 <=> perl4 incompatibility ? (Emil Vatralov)
        privateers (was Re: Copylefting manuals) <ben@hayamasa.demon.co.uk>
        Regexps <erik.alm@swipnet.se>
    Re: sending regex matches to a separate file <abaugher@rnet.com>
    Re: SendKeys <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Special Variables <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Special Variables jstephan@my-dejanews.com
    Re: system() in NT-Perl <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Text File Manipulatoin (John)
        Using Perl 5 with Frontpage and Personal Web Server <Johan.DeConinck@ping.be>
    Re: What's wrong with this?? <JKRY3025@comenius.ms.mff.cuni.cz>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 27 May 1998 19:33:48 GMT
From: kjernigan@geocities.com
Subject: Password decoding...
Message-Id: <6khpqt$5d1$1@nnrp1.dejanews.com>

Hello,
     I am just learning Perl and I am trying to write a program abstracted
from another program. The program is WWW Administration. It is the
administration program the comes with Matt's Script Archived WWWBoard version
2. What I want is a perl script that will take input from a html page and
convert it into the coded version and allow the user into the board if it
worked. This way, I could remove the password on the individual remove pages.
If anyone can help me, I would greatly appreciate it.

KENNY

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 27 May 1998 19:10:22 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Perl for WindowsNT?
Message-Id: <1998052719102200.PAA07045@ladder03.news.aol.com>

Hi T.J.:

> It would be much cheaper to install Windows server software on my computer.
> It doesn't need to be Unix. All I want to do is learn more and make programs
in
> Perl.

Both ports of perl for Windows work with Win95, NT Workstation, and NT
Server. Probably with Win98 as well - but I haven't tested personally. There
are also ports for Macs,  Amigas, OS2, and (with some limitations) MS-DOS.
Checkout CPAN. You certainly should not have to install "Windows Server"
software just for what you want to do.

Of course, if you don't have any of the supported OSs, linux might be
cheaper:-)

-bill

Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: 27 May 1998 16:58:30 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: perl's idea of version numbers
Message-Id: <r8wwb8cgv5.fsf@asc.sps.mot.com>


I found this message suprising:

 rtmx version 1.3 required--this is only version 1.24 at /home/eda/app/share/bin/rtmx line 373.

Is perl reading "1.24" as "version 1.2.4".  I read it as "one - twenty four".

Any comments?  Is this a bug?

Martin.



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

Date: 27 May 1998 20:34:59 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl's idea of version numbers
Message-Id: <6khtdj$ip8$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Martin Gregory <mgregory@asc.sps.mot.com> writes:
:I found this message suprising:
: rtmx version 1.3 required--this is only version 1.24 at /home/eda/app/share/bin/rtmx line 373.
:Is perl reading "1.24" as "version 1.2.4".  I read it as "one - twenty four".
:Any comments?  Is this a bug?

Numbers are numbers.  Think of it as dollars and cents.  $1.3 is really
a buck thirty, whereas $1.24 is still a penny shy of ten bits, and
certainly less than $1.30 no matter how you look at it -- numerically.

Or were you planning on introducing different lexical contexts 
for discerning numbers from versions?  I don't thinks so.

There's a reason we write versions as %.3f or better, you know.

--tom
-- 
As of next week, passwords will be entered in Morse code.


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

Date: 27 May 1998 19:26:24 GMT
From: emil@libra.math.tau.ac.il (Emil Vatralov)
Subject: Re: perl5 <=> perl4 incompatibility ?
Message-Id: <6khpd0$oo5$1@goethe.tau.ac.il>
Keywords: split

Tom,
Thanks for your answer.

> > Can someone, please, explain me why the following
> > small program prints differnt output in perl4 and perl5,
> > perl4 -e '@c = split (/:/, "", -1); print "<$#c>\n"'
> > <0>
> > perl5 -e '@c = split (/:/, "", -1); print "<$#c>\n"'
> > <-1>
 
> Yep; it's documented in perltrap. Hope this helps!
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


Still it is not clear for me.
Do you refer to the below exerpt from perltrap ?
I'm searching an effective way to obtain empty string,
when I try to split by ':' an empty string.

Thanks.
 
---------------- begin include --------------
           split with no arguments now behaves like split ' '
           (which doesn't return an initial null field if $_
           starts with whitespace), it used to behave like split
           /\s+/ (which does).

               $_ = ' hi mom';
               print join(':', split);

               # perl4 prints: :hi:mom
               # perl5 prints: hi:mom
----------------  end include --------------




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

Date: Wed, 27 May 1998 21:30:49 +0100
From: Ben Bullock <ben@hayamasa.demon.co.uk>
Subject: privateers (was Re: Copylefting manuals)
Message-Id: <356C77F9.877D10E@hayamasa.demon.co.uk>

RMS apparently wrote:

> permit such use--as long as we remember that we are treating the
> software privateers better than their actions deserve.

What's a software privateer?  I know that
Privateer was the `politically correct' name that British
pirates gave themselves.
I don't understand what a software privateer is though.

I can't believe it's the same as a software `pirate'.

-- 
Ben Bullock 

Try Cfunctions, a free program for making headers from C files.
Get it from `http://www.hayamasa.demon.co.uk/cfunctions'.


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

Date: Wed, 27 May 1998 22:11:46 +0200
From: Erik Alm <erik.alm@swipnet.se>
Subject: Regexps
Message-Id: <356C7382.277C855E@swipnet.se>

Hello,

I have a problem with regexps.

Is there a way (I know I've heard of it but I can't find it!!) to
override the "greed" in for instance a /(.*?)\"/ so that instead of
matching the last \" ever, it will stop at the very first \"  ?

If not... is there a way to do a match like: anything BUT a \" ?

Regards,

Erik Alm
Stereomedia Stockholm



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

Date: 27 May 1998 12:56:26 -0500
From: Aaron Baugher <abaugher@rnet.com>
Subject: Re: sending regex matches to a separate file
Message-Id: <m2af83oawl.fsf@haruchai.rnet.com>

Mahmoud Ahmed <mahmed@dkl.com> writes:

> Hi Micheal,
> 
> You got it, but don't use array just use variable and also save it on
> output file.
> Here is your modified script... IT WORKS.
> 
> #!/usr/local/bin/perl
> 
> foreach (@ARGV) {
> 
>           open (INFILE,"$_") || die ("Can't Open $_\n");
>           open (OUTFILE,">list.txt") || die ("Can't Open list.txt\n");
> 
>           while ($text=<INFILE>) {
>                 print "$text\n";
>                 while ($text=~s/(http:\/\/.*?)">/$1/) {

The substitution is unnecessary, since you aren't doing anything with
$text afterwards:

                while ($text=~ /(http:\/\/.*?)">/) {

You'll still get what's between the () in $1.

>                    print OUTFILE "$1\n";    # Store output file
>                 }
>          }
>         close (INFILE);
>         close (OUTFILE);
> }


--
Aaron Baugher
Extreme Systems Consulting
CGI, Perl, Java, and Unix Administration
http://haruchai.rnet.com/esc/


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

Date: Wed, 27 May 1998 22:06:30 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: SendKeys
Message-Id: <356CF0D6.C67@comenius.ms.mff.cuni.cz>

jstephan@my-dejanews.com wrote:
> 
> Hi,
> 
> I'm wondering if there's a way to send keystrokes to another application in
> Perl on a Win32 system.  I've seen it done in an Excel macro with SendKeys().
> If the soulution is not standard Perl and I need to download a module, that's
> still ok.
> 
> Thanks in advance,
> -Jon Stephan
> 
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading

use Win32::Setupsup;

# ftp://ftp.roth.net/pub/ntperl/setupsup/

The AS port only :-(

HTH, Jenda


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

Date: Wed, 27 May 1998 22:24:50 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Special Variables
Message-Id: <356CF522.DC5@comenius.ms.mff.cuni.cz>

bthak@bascom.com wrote:
> 
> Is there a special variable that holds the value of the last failed match.
> 
> Consider the following code..
> 
> @array = qw(123 34455 35 4r6 8654 687688);
> 
> foreach $index (0..$#array){
>    if $array[$index] =~ /^\d+$/){
>        $count++;
>    }
>    else {
>        print "Not all digits";
>        last;
>    }
> }
> 
> I would like to get the vaule of the non digit part. Simple put (i think) the
> value where the loop breaks out. Is it stored in a special variable such as $_
> is the value of last successful match.

Not exactly what you asked for:

#!/usr/bin/perl
@array = qw(123 34455 35 4r6 8654 687688);

foreach $index (0..$#array){
  if ($array[$index] =~ /(\D+)/){
       print "Not all digits : $1\n";
       last;
  } else {
       $count++;
  }
}
__END__

Revert the condition to match the nondigits and create a backreference
for them.

BTW, you should consult man perlvar if you are looking for a special
variable.

Jenda


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

Date: Wed, 27 May 1998 20:46:23 GMT
From: jstephan@my-dejanews.com
Subject: Re: Special Variables
Message-Id: <6khu30$cmv$1@nnrp1.dejanews.com>

The obvious answer is:

@array = qw(123 34455 35 4r6 8654 687688);
foreach $index (0..$#array){
   if ($array[$index] =~ /^\d+$/){
       $count++;
   }   else {
       print "Not all digits\n";
       $nonmatch = $index;
       last;
   }
}
print "first nonmatch = $nonmatch";

I'm not sure if you're looking for something more elegant, though.


In article <6khmtg$3u$1@nnrp1.dejanews.com>,
  bthak@bascom.com wrote:
>
> Is there a special variable that holds the value of the last failed match.
>
> Consider the following code..
>
> @array = qw(123 34455 35 4r6 8654 687688);
>
> foreach $index (0..$#array){
>    if $array[$index] =~ /^\d+$/){
>        $count++;
>    }
>    else {
>        print "Not all digits";
>        last;
>    }
> }
>
> I would like to get the vaule of the non digit part. Simple put (i think)
the
> value where the loop breaks out. Is it stored in a special variable such as
$_
> is the value of last successful match.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/   Now offering spam-free web-based newsreading
>


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 27 May 1998 22:26:33 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: system() in NT-Perl
Message-Id: <356CF589.1384@comenius.ms.mff.cuni.cz>

Jan Setnan wrote:
> 
> Hi ..
> I'm running this simple program (dir.pl) :
>      $utfil = "d:\\temp\\utfil.txt";
>      system(qq(dir > $utfil));
> on a PC with Windows NT 4.0.
> When I run it from the command prompt, it works OK,
> the file utfil.txt is created and it contains the directory listing.
> But when I try to schedule it with "at 12:00 perl dir.pl"
> nothing happens, no file is created.
> What's up ??
> 
> Jan

c:\> at 12:00 "perl dir.pl"

Note the quotes!
You should use full path to the script, I don't know what the current
directory
will be when the scheduled program (perl.exe) starts.

Jenda


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

Date: 27 May 1998 19:54:53 GMT
From: johns@cc.gatech.edu (John)
Subject: Re: Text File Manipulatoin
Message-Id: <6khr2d$gro$1@news-int.gatech.edu>

John (johns@cc.gatech.edu) wrote:
: This finds an entire line, but not part of a line.  How can I change
: this so that it looks WITHIN a line of text and replaces only part of
: that text.  Also, it doesn't seem to write back to the file properly.
: The file never changes with that "print AUTOEXEC..." part, but if I
: change it so that it does "print 'found the text';" it lets me know
: that the text has been found (but only if I match the ENTIRE line).

Okay, I figured out some of this.  I figured out pattern matching,
but now I don't know how to edit just part of a line.  I can
find the text that's embedded in a line, but then all I've been able
to do is write a WHOLE new line.  What I want to do is just remove
the pattern I'm searching for and replace it with some other text
that isn't necessarily the same size at the pattern being removed.
Could someone point me in the right direction here?

-- 
John Q. Sindell Jr.
jqs@pikapp.net
jqsindel@gapac.com
http://www.cc.gatech.edu/~johns


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

Date: Wed, 27 May 1998 20:54:18 +0200
From: "Johan De Coninck" <Johan.DeConinck@ping.be>
Subject: Using Perl 5 with Frontpage and Personal Web Server
Message-Id: <6khnr4$fv6$1@news3.Belgium.EU.net>

Has anyone any feedback or documentation about how to use Perl 5 with
Frontpage and Personal Web Server on a local drive for testing purposes ?

Thanks




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

Date: Wed, 27 May 1998 22:15:14 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: What's wrong with this??
Message-Id: <356CF2E2.76D1@comenius.ms.mff.cuni.cz>

Either :
	...
	$data->Sql("select misa, misb, count(misd) from mistable 
	            group by misa, misb order by misb");
 
	while ($data->FetchRow( ))
	{
	 ($misa, $misb, $misd) = $data->Data();
	  # if you do not specify what you want
	  # you will get all items, in the order
	  # you specified them in the SELECT statement
	...

or:

	...
	$data->Sql("select misa, misb, count(misd) AS count_misd from mistable 
	            group by misa, misb order by misb");
 
	while ($data->FetchRow( ))
	{
	 ($misa, $misb, $misd) = $data->Data( "misa", "misb", "count_misd");
	...

If your database doesn't support "expression AS name" you may try
	select misa, misb, count_misd = count(misd) from mistable ...
as well.


HTH, Jenda


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

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

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