[11323] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4923 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 17 23:07:27 1999

Date: Wed, 17 Feb 99 20:00:21 -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           Wed, 17 Feb 1999     Volume: 8 Number: 4923

Today's topics:
    Re: "Timeout" on opening a device? (David Efflandt)
        Anybody get .pl scripts to run on Win32 Perl and Apache (Rod MacBain)
    Re: Anybody get .pl scripts to run on Win32 Perl and Ap (Mab)
    Re: Can anyone convert this VB script to Perl? (win32:: Richard.Mayston@mfat.govt.nz
    Re: converting a standard number to a currency-like num <allan@due.net>
        FAQ 5.2: How do I change one line in a file/delete a li <perlfaq-suggestions@perl.com>
        FAQ 5.3: How do I count the number of lines in a file?  <perlfaq-suggestions@perl.com>
        FAQ 5.4: How do I make a temporary file name?   <perlfaq-suggestions@perl.com>
    Re: Help,,, (Apache server) <ringo6@worldnet.att.net>
        mod_perl on os2? (sthoenna@efn.org)
        MYSQL, PERL AND PWS <fajar@bdg.centrin.net.id>
        Problems getting rid of \n!! <sbott@earthlink.net>
        RealTimeBattle - RobotWar Clone using perl for robots <dagarath@my-dejanews.com>
    Re: regex poll (Todd Lehman)
    Re: regex poll <scribble@pobox.com>
    Re: Regular Expression Help (Charles DeRykus)
        Returning IP address.... <cjgebha@enteract.com>
    Re: Returning IP address.... (David Efflandt)
        String Manipulation (yet another newbie question) asssi@my-dejanews.com
        Variable for variable names zin@clanplaid.net
    Re: Web Browser Setup (Tad McClellan)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 18 Feb 1999 02:01:42 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: "Timeout" on opening a device?
Message-Id: <slrn7cmt2c.hf.efflandt@efflandt.xnet.com>

On Wed, 17 Feb 1999 14:43:53 +0100, Claudio Strizzolo
<Claudio.Strizzolo@trieste.infn.it> wrote:
>	I am writing a small script to send messages to connected
>terminals, from root account on a Digital Unix machine.
>A portion of the code follows:
>
>if (open(TERMINAL,">$terminal")) {
>  print TERMINAL sprintf("TEST\n\r");
>  close(TERMINAL);
>}
>
>$terminal is something like "/dev/ttyp3" or such. I get the list of
>terminals through the "who" command. From time to time, due to a
>malfunctioning in the upgrading of the file which "who" reads to
>get the list of terminals, the list of terminals I try to "open"
>is not up-to-date. In particular, some of the terminals might be
>unavailable (i.e.: dead long time ago), though they are still 
>identified as available by "who". When I try to "open" the connection 
>to such a terminal, it hangs and stays there forever.
>I am looking for a way to avoid this. Maybe a kind of timeout
>on the "open" function? Any hints?
>Thanks in advance

Although, this particular routine is to avoid long delays resolving a
list of possibly bogus hostnames, it should give you a clue. $timeout is
in seconds:

eval {
	local $SIG{ALRM} = sub { die "get IP timed out"; };
	alarm $timeout;
	$addr = gethostbyname $addr;
	alarm 0;	# cancel alarm on success
};
# $@ contains die message if alarm timed out
print "Timed out in $timeout seconds.\n" if $@;

-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

Date: Thu, 18 Feb 1999 03:06:03 GMT
From: darcys@.nbnet.nb.ca (Rod MacBain)
Subject: Anybody get .pl scripts to run on Win32 Perl and Apache 1.3.3. &#$%*Damn MS Windoze file associations.
Message-Id: <36cb7eff.4040385@allnews.nbnet.nb.ca>

Here's the thing - I've had the Win32 apache 1.3.3 server running for
a while and it serves standard HTML no problem. All my perl scripts
run fine if I run them from the command line like (perl.exe hello.pl)
but I can't get seem to get  the files to associate properly. Am I
missing something? I've got the shebang setup properly to
#!C:\pelr\bin\ and I've done the standard windoze file association
thing and setup the .pl extension to run with C:\perl\bin\perl.exe %1
%* as per the activestate documentation but I can't run a perl file
directly from the explorer. So obviously I can't get anything to run
by POSTing it input from the server since I can't even get it to
"hello world" properly by running it from the command line. Has
anybody got the file associations to work properly it a Win95 and
Perl 5 environment? How do you do it?

Much more of this and I'm loading RedHat.


Thanks
Rod


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

Date: Thu, 18 Feb 1999 04:44:01 GMT
From: mhamilton@bunge.com.au (Mab)
Subject: Re: Anybody get .pl scripts to run on Win32 Perl and Apache 1.3.3. &#$%*Damn MS Windoze file associations.
Message-Id: <h%Ly2.9$Y12.6487@vic.nntp.telstra.net>

In article <36cb7eff.4040385@allnews.nbnet.nb.ca>, someone calling themselves darcys@.nbnet.nb.ca (Rod MacBain) wrote:
>Here's the thing - I've had the Win32 apache 1.3.3 server running for
>a while and it serves standard HTML no problem. All my perl scripts
>run fine if I run them from the command line like (perl.exe hello.pl)
>but I can't get seem to get  the files to associate properly. Am I
>missing something? I've got the shebang setup properly to
>#!C:\pelr\bin\ and I've done the standard windoze file association
>thing and setup the .pl extension to run with C:\perl\bin\perl.exe %1
>%* as per the activestate documentation but I can't run a perl file
>directly from the explorer. So obviously I can't get anything to run
>by POSTing it input from the server since I can't even get it to
>"hello world" properly by running it from the command line. Has
>anybody got the file associations to work properly it a Win95 and
>Perl 5 environment? How do you do it?
>
>Much more of this and I'm loading RedHat.

What is the error that explorer gives you when you try to execute a 
perl script? I've never seen %* used before (logic tells me that it 
means "all arguments"), so perhaps that's confusing it.

The best bet as far as explorer is concerned is to unassociate .pl 
with everything, and then double-click on a .pl file. Let windows ask 
you what you want to run it with, and browse for c:\perl\bin\perl.exe. 
That should fix that.

Perhaps it will also fix the apache problem, tho I would guess that 
this is more about apache's own file-association's than windows'.

HTH
Mab


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

Date: Thu, 18 Feb 1999 00:55:51 GMT
From: Richard.Mayston@mfat.govt.nz
Subject: Re: Can anyone convert this VB script to Perl? (win32::ole)
Message-Id: <7afoei$38p$1@nnrp1.dejanews.com>

I've got a bit further

use Win32::ole;
$LogonName = "Richard Mayston";
$objSession = Win32::OLE->new('MAPI.Session', \&OleQuit) or die "Oops, cannot
start MAPI.Session: $!";
die "Logon: $!" if $objSession->Logon($LogonName);
$objMsgColl = $objSession->Inbox.Messages;
$cUnread=0;
$objMessage = $objMsgColl.GetFirst;
while (defined($objMessage)){
	if ($objMessage.Unread){
		$cUnread++;
	}
	$objMessage = $objMsgColl.GetNext;
	print "test: cUnread=$cUnread\tobjMessage=$objMessage\n";
	#test: cUnread=786
#objMessage=Win32::OLE=HASH(0x10cd9fc)MessagesGetNext
}
print "Unread messages = $cUnread\n";


But $objMessage is never undefined & the unread count goes forever!.
Anything obvious wrong?












In article <7afimu$ua7$1@nnrp1.dejanews.com>,
  Richard.Mayston@mfat.govt.nz wrote:
> Many thanks, that was a great start & I feel VERY close, but not quite there
> yet. It seems to log in OK, select the Inbox OK, but then how to access the
> messages?. The ActiveState Perl OLE syntax had me fooled for a while!.
>
> use Win32::ole;
> $LogonName = "Richard Mayston";
> $objSession = Win32::OLE->new('MAPI.Session', \&OleQuit) or die "Oops, cannot
> start MAPI.Session: $!";
> die "Logon: $!" if $objSession->Logon($LogonName);
> $objMsgColl = $objSession->Inbox.Messages;
>
> $objMessage = $objMsgColl->GetFirst;
> #this returns...Can't locate object method "GetFirst" via package
> "Win32::OLE=HASH(0xcaff64)Messages" at exchange.pl line 7.
>
> # VB example
> #	` create a session then log on, supplying username and password
> #	Set objSession = CreateObject("MAPI.Session")
> #	` change the parameters to valid values for your configuration
> #	objSession.Logon 'profileName:="Richard Mayston"'
> #	` use an explicit variable to refer to the collection;
> #	` the Get methods return two different messages
> #	Set objMsgColl = objSession.Inbox.Messages
> #	Set objMessage = objMsgColl.GetFirst
> #	` ...
> #	Set objMessage = objMsgColl.GetNext
>
> sub OleQuit {
> 	    my $self = shift;
> 	    $self->Quit;
> 	}
>
> In article <7adqke$nm6$1@news1.fast.net>,
>   "John Counts" <jcounts@voicenet.com> wrote:
> > I'm only guessing because we don't have an exchange server, but I use
> > Win32::OLE to use ADO objects so the syntax should be similar. I'm sure
> > there are plenty of mistakes, but it might help you get started.
> >
> > #! c:/perl/bin/perl.exe -w
> >
> > use Win32::OLE;
> >
> > $objSession = CreateObject OLE ("MAPI.Session") ;
> > $objSession->Logon (profileName:="Princess Leia");
> > $objMessages = CreateObject OLE("MAPI.[Messages Collection]);
> > $objMessages -> Open ([Messages Collection]); # I'm guessing that there is
> > an open member
> > $retval = &Util_CountUnread();
> > print "Unread messages = $retval\n";
> >
> > sub Util_CountUnread {
> >     $cUnread = 0;
> >      if ( ! defined ($objMessages)){
> >         print "must select a messages collection\n";
> >         return (0);
> >     }
> >     $objMessages->GetFirst;
> >     while (defined($objMessages)) {
> >         if  ($objMessage->Unread) {
> >             $cUnread++;
> >         }
> >         $objMessages->GetNext;
> >     }
> > return ($cUnread);
> > }
> >
> > Richard.Mayston@mfat.govt.nz wrote in message
> > <7ad59g$qjj$1@nnrp1.dejanews.com>...
> > >We have an Exchange4.0 server with a couple of mailboxes that do automatic
> > >document conversions, and occasionally the the process dies & the messages
> > >bank up in the mailbox. I'd like a Perl script the checks for unread
> > messages
> > >& alerts the HelpDesk if necessary. Technet has an article Programmer's
> > >Guide: MS OLE Messaging with a Visual Basic example.
> > >
> > >Can anyone help convert the following VB script to Perl?
> > >I've got as far as:
> > >use Win32::OLE;
> > >
> >
> >
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 17 Feb 1999 20:00:39 -0500
From: "Allan M. Due" <allan@due.net>
Subject: Re: converting a standard number to a currency-like number
Message-Id: <cDJy2.133$986.2248@nntp1.nac.net>

Peter Richmond wrote in message <36CB596B.31238CBD@richmd.demon.co.uk>...
:Hi,
:Sorry if the subject is not clear. Here is the problem...
:I have a numerical value: 2474911568
:And i need to convert it into: 2,474,911,568
:Can any help me solve this problem?


Ok, maybe FAQs should be called SHFD (Start Here First Damnit) <g>  If you
have Perl you have the FAQs (and nothing but the FAQS mam).

perlfaq5:  "How can I output my numbers with commas added?"

HTH

AmD

:PS: Please reply to my email address rather than the newsgroup. Thanks

The convention for this newsgroup is post here read here.  Hope you undersand.





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

Date: 17 Feb 1999 18:28:13 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?  
Message-Id: <36cb6cad@csnews>

(This excerpt from perlfaq5 - Files and Formats 
    ($Revision: 1.34 $, $Date: 1999/01/08 05:46:13 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq5.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?

    Those are operations of a text editor. Perl is not a text editor. Perl
    is a programming language. You have to decompose the problem into low-
    level calls to read, write, open, close, and seek.

    Although humans have an easy time thinking of a text file as being a
    sequence of lines that operates much like a stack of playing cards -- or
    punch cards -- computers usually see the text file as a sequence of
    bytes. In general, there's no direct way for Perl to seek to a
    particular line of a file, insert text into a file, or remove text from
    a file.

    (There are exceptions in special circumstances. You can add or remove at
    the very end of the file. Another is replacing a sequence of bytes with
    another sequence of the same length. Another is using the `$DB_RECNO'
    array bindings as documented in the DB_File manpage. Yet another is
    manipulating files with all lines the same length.)

    The general solution is to create a temporary copy of the text file with
    the changes you want, then copy that over the original. This assumes no
    locking.

        $old = $file;
        $new = "$file.tmp.$$";
        $bak = "$file.orig";

        open(OLD, "< $old")         or die "can't open $old: $!";
        open(NEW, "> $new")         or die "can't open $new: $!";

        # Correct typos, preserving case
        while (<OLD>) {
            s/\b(p)earl\b/${1}erl/i;
            (print NEW $_)          or die "can't write to $new: $!";
        }

        close(OLD)                  or die "can't close $old: $!";
        close(NEW)                  or die "can't close $new: $!";

        rename($old, $bak)          or die "can't rename $old to $bak: $!";
        rename($new, $old)          or die "can't rename $new to $old: $!";

    Perl can do this sort of thing for you automatically with the `-i'
    command-line switch or the closely-related `$^I' variable (see the
    perlrun manpage for more details). Note that `-i' may require a suffix
    on some non-Unix systems; see the platform-specific documentation that
    came with your port.

        # Renumber a series of tests from the command line
        perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e' t/op/taint.t

        # form a script
        local($^I, @ARGV) = ('.orig', glob("*.c"));
        while (<>) {
            if ($. == 1) {
                print "This line should appear at the top of each file\n";
            }
            s/\b(p)earl\b/${1}erl/i;        # Correct typos, preserving case
            print;
            close ARGV if eof;              # Reset $.
        }

    If you need to seek to an arbitrary line of a file that changes
    infrequently, you could build up an index of byte positions of where the
    line ends are in the file. If the file is large, an index of every tenth
    or hundredth line end would allow you to seek and read fairly
    efficiently. If the file is sorted, try the look.pl library (part of the
    standard perl distribution).

    In the unique case of deleting lines at the end of a file, you can use
    tell() and truncate(). The following code snippet deletes the last line
    of a file without making a copy or reading the whole file into memory:

            open (FH, "+< $file");
            while ( <FH> ) { $addr = tell(FH) unless eof(FH) }
            truncate(FH, $addr);

    Error checking is left as an exercise for the reader.

-- 
:       I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it.  Any ideas?  (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>


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

Date: 17 Feb 1999 19:28:17 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 5.3: How do I count the number of lines in a file?  
Message-Id: <36cb7ac1@csnews>

(This excerpt from perlfaq5 - Files and Formats 
    ($Revision: 1.34 $, $Date: 1999/01/08 05:46:13 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq5.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I count the number of lines in a file?

    One fairly efficient way is to count newlines in the file. The following
    program uses a feature of tr///, as documented in the perlop manpage. If
    your text file doesn't end with a newline, then it's not really a proper
    text file, so this may report one fewer line than you expect.

        $lines = 0;
        open(FILE, $filename) or die "Can't open `$filename': $!";
        while (sysread FILE, $buffer, 4096) {
            $lines += ($buffer =~ tr/\n//);
        }
        close FILE;

    This assumes no funny games with newline translations.

-- 
    Because . doesn't match \n.  [\0-\377] is the most efficient way to match
    everything currently.  Maybe \e should match everything.  And \E would
    of course match nothing.   :-) --Larry Wall in <9847@jpl-devvax.JPL.NASA.GOV>


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

Date: 17 Feb 1999 20:28:19 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 5.4: How do I make a temporary file name?  
Message-Id: <36cb88d3@csnews>

(This excerpt from perlfaq5 - Files and Formats 
    ($Revision: 1.34 $, $Date: 1999/01/08 05:46:13 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq5.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I make a temporary file name?

    Use the `new_tmpfile' class method from the IO::File module to get a
    filehandle opened for reading and writing. Use this if you don't need to
    know the file's name.

        use IO::File;
        $fh = IO::File->new_tmpfile()
            or die "Unable to make new temporary file: $!";

    Or you can use the `tmpnam' function from the POSIX module to get a
    filename that you then open yourself. Use this if you do need to know
    the file's name.

        use Fcntl;
        use POSIX qw(tmpnam);

        # try new temporary filenames until we get one that didn't already
        # exist;  the check should be unnecessary, but you can't be too careful
        do { $name = tmpnam() }
            until sysopen(FH, $name, O_RDWR|O_CREAT|O_EXCL);

        # install atexit-style handler so that when we exit or die,
        # we automatically delete this temporary file
        END { unlink($name) or die "Couldn't unlink $name : $!" }

        # now go on to use the file ...

    If you're committed to doing this by hand, use the process ID and/or the
    current time-value. If you need to have many temporary files in one
    process, use a counter:

        BEGIN {
            use Fcntl;
            my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMP} || $ENV{TEMP};
            my $base_name = sprintf("%s/%d-%d-0000", $temp_dir, $$, time());
            sub temp_file {
                local *FH;
                my $count = 0;
                until (defined(fileno(FH)) || $count++ > 100) {
                    $base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
                    sysopen(FH, $base_name, O_WRONLY|O_EXCL|O_CREAT);
                }
                if (defined(fileno(FH))
                    return (*FH, $base_name);
                } else {
                    return ();
                }
            }
        }

-- 
If the code and the comments disagree, then both are probably wrong.
                --Norm Schryer


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

Date: 18 Feb 1999 03:35:14 GMT
From: "Michael Taylor" <ringo6@worldnet.att.net>
Subject: Re: Help,,, (Apache server)
Message-Id: <7ag1pi$5hh@bgtnsc03.worldnet.att.net>

Um.....except for the fact that some of your cgi scripts are perl, you're at
the wrong newsgroup.

However:  edit the httpd.conf file and specify the cgi-bin directory, and
check the other options in the file as well..

ringo@ringos-world.com

Bababozorg wrote in message <19990217072636.18614.00002874@ng04.aol.com>...
>hi
>i installed apache web server in my comp but i cant make it read the cgi or
>perl scripts it just give me 500 Internal Server Error every time i run the
>scripts.
>i think i have to write the address or perl.exe somewhere but i dont know
where
>to write that
>can you help me please
>thanks
>hamed




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

Date: Wed, 17 Feb 1999 22:18:27 GMT
From: sthoenna@efn.org (sthoenna@efn.org)
Subject: mod_perl on os2?
Message-Id: <zA0y2gzkgalW092yn@efn.org>

Just wondering if anyone has gotten mod_perl running under os2.
I'm using perl5.00553 and apache 1.3.4.


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

Date: Fri, 12 Feb 1999 12:26:38 -0800
From: "Fajar Siswandaru" <fajar@bdg.centrin.net.id>
Subject: MYSQL, PERL AND PWS
Message-Id: <36c46615.0@news.centrin.net.id>

Hi Everyone...

I've download mysql for Win32 from tcx and Perl For Win32
from activestate..
But how to make them 'talk to each other' on PWS?
I know that this problem can be solved by installing
Perl DBI...But how to install the DBI module on Windows?

I need to preview my database perl script on PWS,
before upload it into UNIX based webserver...

Thanx for any of your help...

Fajar S
fajar@bdg.centrin.net.id
Ph : 62-022-2502117
Bandung, Indonesia..





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

Date: Wed, 17 Feb 1999 16:43:28 -0800
From: Steven Bott <sbott@earthlink.net>
Subject: Problems getting rid of \n!!
Message-Id: <36CB6227.4E0EDD19@earthlink.net>

I have a question about writing data to a file without the returns -
replacing the \n with the word RETURN....

I have tried

s/\n/RETURN/g;

but I can only get rid of one return by using that on the $val in
cgi-lib.pl.
When I try

s/\n\n/RETURN/g;

nothing happens!

I keep getting two returns for one, and I can only get rid of one.  Am I

putting the command in the wrong place??  I tried it in the program just

before writing it to the file, but my syntax was incorrect when using
values(%input_array) = s/\n/RETURN/g;.

Does anyone know why this extra return won't go away and what I'm doing
wrong?  Someone suggested chop($val); but as a newbie, I have no idea
where to put it.  I also have no idea why the substitute isn't doing it!

Thank You in Advance!!

Steven Bott
sbott@earthlink.net







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

Date: Thu, 18 Feb 1999 02:29:47 GMT
From: Dagarath <dagarath@my-dejanews.com>
Subject: RealTimeBattle - RobotWar Clone using perl for robots
Message-Id: <7aftuh$7vc$1@nnrp1.dejanews.com>

RealTimeBattle http://realtimebattle.netpedia.net/ is a *nix game using X and
Gtk.  The game is similar to the old RobotWar game by Muse.  And newer
versions like CRobots, C++Robots, RobotBattle, and others.  The object to to
write a program that controls a robot in a battle arena.

RealTimeBattle allows multiple programming languages to be used.  Robots can
be constructed with C, C++, Perl, Python, etc.	Sample robots are available
in C and C++.  I've got a basic perl robot started and hope to release it as
a model for perl based robots.


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 17 Feb 1999 16:09:18 -0600
From: lehman@javanet.com (Todd Lehman)
Subject: Re: regex poll
Message-Id: <MPG.1134fa05686baaa79896ae@news.javanet.com>

In comp.lang.perl.moderated, pudge@pobox.com (Chris Nandor) writes:
> [...]
> I have several goals in life.  One is to help stomp out the irresponsible
> use of information.  This is a clear example of it.

Well, to the purpose of Uri's summarizing things for the group, I
think this is simply an example of casual (unscientific) collection
and dissemination of some interesting information.  If Uri
subsequently tries to argue a point with Ilya based on this
information, then that's arguably irresponsible, but that's really
Uri's and Ilya's business.


> I ask you all to help by not participating.

I fully intend to e-mail Uri my responses, and I'm looking forward to
seeing the results.  (I hope Uri posts them, even if he only gets 20
responses.)  I think seeing even 5 responses could be useful
information.  Everyone has to interpret it their own way, of course.
For example, I hope the data can be presented in raw form as well, so
readers have the option to normalize the data sets before calculating
averages or other statistical features.

--Todd

p.s.  By reading Uri's list, I just learned of the existence of a couple 
recentish constructs that I didn't know existed.


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

Date: 17 Feb 1999 15:16:38 -0600
From: Tushar Samant <scribble@pobox.com>
Subject: Re: regex poll
Message-Id: <7afbjm$8np@masu.wwa.com>

I want to know if there is any connection between this poll being
a disinformation campaign and the fact that my "survey" answers
were rejected. I ask this for one because a near-identical post has
appeared on the group, but mainly because I want to know how a Perl
programmer's post about his programming habits is inappropriate. It
doesn't sound like a borderline case on which different moderators
might disagree.  

I will certainly gain something from seeing certain people's answers,
namely people about whose personalities and concerns I know something
by reading the group. If I find someone who is exactly like me but
uses one feature far more than I do, I know what to play with next.
If I see someone in the web business not using a "useful" feature
at all, I could ask them how they solve certain problems... and
maybe end up learning another way.

And perhaps the poll was intended to sway The Mighty Zakharevich,
but the possibility of that happening is laughably small. It's just
not the kind of energy which gets rechannelled by a voice vote,
that's the valuable thing about it...


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

Date: Thu, 18 Feb 1999 01:39:13 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Regular Expression Help
Message-Id: <F7BtxD.6Mq@news.boeing.com>

In article <36cb2f2f.0@news.vcss.k12.ca.us>,
Dan Kubilos <dkubilo@oxnardsd.org> wrote:
>
>1.  I want to force a username between 3 and 8 alpha characters
>  I tried  $variable =~ /[a-z]{3,8}?/
>
>This only checks that there are 3 minimum.  but still matches any number of
>[a-z]  so dkdkdkdkdkdkdkdk matches ??
>

Did you intend to use the non-greedy quantifier C<?>... 
That'll force a minimal match of 3 characters. Whether 
minimal or not though, your regex doesn't preclude 
there being more than 3 to 8 alpha characters.   

Probably easiest to use C<^> and C<$> 

   $variable =~ /^[a-z]{3,8}$/;

For full details:  perldoc perlre    


>2.  I want to force full name as First Last with no middle initial
>
>  $variable =~ /[A-Z]\D+\s[A-Z]/   matches with Dan C Kubilos  ??
>


This'll be tough to craft a good regex because
of weird names :), e.g. 

Ruud de Beers
Jon D'Arcy 
Joe-Bob Briggs
Merrie Waite-Ahweil
Walter Van De Meer III 
John Doe Jr.


Perhaps someone will post an algorithm that'll get
most of 'em. 


>3.  Probably not regex,  but again me the newbie dude is stumped.
>
>I want to check that group number entered is valid.
>
>tried  $varible == 30...230     to no avail
>tried   $variable =~ /^[2-3]{1}[0-9]{1,2}/
>

A regex isn't the way to go here.  Try something
like:

$variable >=30 and $variable <=230


hth,
--
Charles DeRykus


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

Date: Thu, 18 Feb 1999 00:55:35 +0000
From: Chris Gebhardt <cjgebha@enteract.com>
Subject: Returning IP address....
Message-Id: <36CB6507.8DF775D@enteract.com>

Thanks for helping in advance.

I need some information on writing a script.  I am not a programmer by
any means but I like to mess around with things here and there.

What I am trying to do with no success so far is to ping a host on the
internet to validate my network connection is active and have it return
a Connected or NotConnected Status to my webpage.  I have the .pl page
written for the HTML print.  How would I intagrate the ping into the .pl
script.   My basic setup is 1 linux router (IP masqurading) and one
linux client.

Please Advise!!!  If you need more information please email me with what
information you need.

Thanks...

Chris Gebhardt



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

Date: 18 Feb 1999 02:41:01 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Returning IP address....
Message-Id: <slrn7cmvc4.hf.efflandt@efflandt.xnet.com>

On Thu, 18 Feb 1999 00:55:35 +0000, Chris Gebhardt <cjgebha@enteract.com> wrote:
>Thanks for helping in advance.
>
>I need some information on writing a script.  I am not a programmer by
>any means but I like to mess around with things here and there.
>
>What I am trying to do with no success so far is to ping a host on the
>internet to validate my network connection is active and have it return
>a Connected or NotConnected Status to my webpage.  I have the .pl page
>written for the HTML print.  How would I intagrate the ping into the .pl
>script.   My basic setup is 1 linux router (IP masqurading) and one
>linux client.
>
>Please Advise!!!  If you need more information please email me with what
>information you need.

See wwwtest at http://www.xnet.com/~efflandt/pub/wwwpost/

-- 
David Efflandt    efflandt@xnet.com
http://www.xnet.com/~efflandt/


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

Date: Thu, 18 Feb 1999 01:57:01 GMT
From: asssi@my-dejanews.com
Subject: String Manipulation (yet another newbie question)
Message-Id: <7afs18$6eq$1@nnrp1.dejanews.com>

Here it goes...
      I read a whole lots about how quickly and easily perl can be
used for search and replace operation. it is described in detail in many
web sites and tutorials..
      However what i need to do is much simpler and i couldn't find away
how to do it.
i have a variable that may contain or may not contain a sub-string
somewhere inside.. for example if i have:
$field = "email_1"

what i want to do is this:
if ($field contains "_1") { etc. etc. etc. }

so, what comes inside the brackets?

Thank you.
Asi.




-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 18 Feb 1999 03:38:20 GMT
From: zin@clanplaid.net
Subject: Variable for variable names
Message-Id: <7ag1vb$bds$1@nnrp1.dejanews.com>

I'm a relative perl newbie, and I was wondering if there's any way to have a
loop act upon a different variable on each iteration.  I was hoping to have an
array with variable names ($foo, $bar, $etc) and then have a for loop
to call the different elements of the array within a statement, such as
"$vararray[$i] = valuexyz;" where $vararray[$i] is actually $foo, so that
valuexyz goes into $foo.

Is there any way of doing this?


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 17 Feb 1999 19:58:28 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Web Browser Setup
Message-Id: <44sfa7.pab.ln@magna.metronet.com>

Bob Laflamme (rlaflamm@sscinc.com) wrote:
: I have some perl scripts which run on NT IIS. When I access the url from
: Internet Explorer 4.x, everything works fine. However, when using Netscape
: or older versions of IE, the user gets prompted with the "Save As" dialog.

: I aruge that the problem is with the web client, others say the server is
: the issue. I don't agree because it works with some clients and jnot others.
: Are there settings in the browser that need to change?


   So what is your Perl question?


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


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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