[6793] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 418 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 3 02:07:26 1997

Date: Fri, 2 May 97 23:00:23 -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           Fri, 2 May 1997     Volume: 8 Number: 418

Today's topics:
     Re: a question on striping characters <dorman@s3i.com>
     Re: a question on striping characters <dorman@s3i.com>
     Re: a2p support redirection? (Russell Schulz)
     Re: Best way to read from STDIN twice? (Chipmunk)
     Can I create a filehandle from socket descriptor? <petew@lexis-nexis.com>
     Re: capturing user info <rootbeer@teleport.com>
     Re: dbmopen fails. <rootbeer@teleport.com>
     File Descriptors <mishra.aditya@emeryworld.com>
     Re: getting and derefencing in one go <rootbeer@teleport.com>
     Re: Hexadecimal  search and replace? <rootbeer@teleport.com>
     Re: Hostname <rootbeer@teleport.com>
     How plausible is it to make 'foo' in perl? (Jahwan Kim)
     Re: how to compile and execute a program from perl <rootbeer@teleport.com>
     Re: Launching Cold Fusion URL from perl script <rootbeer@teleport.com>
     Re: Loosing clpm regulars (was Re: Perl auto-replier) (Mark Mills)
     Re: Network Programming and Sockets <jay@rgrs.com>
     Re: ODBC & Perl <billc@tibinc.com>
     Pattern Match Question (Claudia  Ma)
     Re: Perl and fixing dynamic URLS <rootbeer@teleport.com>
     Re: PERL Editor (Nicholas Carey)
     Re: perl5 & gdbm on different platforms (Mike Heins)
     Re: pre-RFD: comp.lang.perl.{data-structure,inter-proce (Nicholas Carey)
     problems receiving lines from modem <sheadley@cyberramp.net>
     Re: problems with the debugger <rootbeer@teleport.com>
     Re: program for perl? (E.)
     Re: Q on:   map { @M=$_=~/(\S+)/g && [$_, $M[$col]]  }  (Tim Gim Yee)
     scalar holds compiled code (Tom Vaughan)
     Re: Why no regex char class for punc chars??? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 02 May 1997 09:26:55 -0400
From: Clark Dorman <dorman@s3i.com>
Subject: Re: a question on striping characters
Message-Id: <dwwpixaw0.fsf@s3i.com>


abigail@fnx.com (Abigail) writes:
> On 1 May 1997 18:44:51 GMT, Jeff Stampes wrote in comp.lang.perl.misc
> ++ 
> ++ spanky@direct.ca wrote:
> ++ : how can you strip the character string, Ex ->  "I_LIKE_THE_NUMBER_9"
> ++ : to get just the number 9?
> ++ 
> ++ By reading the perlfunc manpage and studying the substr() function,
> ++ or the perlre manpage and understanding how regular expressions
> ++ work.  Or you could see the FAQ, or read any perl book, or even
> ++ search Deja News.
> ++ 
> ++ $foo = "I_LIKE_THE_NUMBER_9"
> ++ $bar = substr($foo,-1,1);
> 
> This gets the last character of the string, regardless whether it's
> a number or not.
> 
> $foo = "I_LIKE_THE_NUMBER_9";
> $bar =~ s/[^\d]+//g;
> 
> strips out all non numbers.

1.  How does the substitution expression know to work on $foo?  It seems 
    that $_ is not being set to $foo. 
2.  The above mushes all the numbers into one big number.  Try:

#!/home/dorman/bin/perl -w

$bar = $foo = "I_LIKE_THE_NUMBER_9_AND_THE_NUMBER_12";
$bar =~ s/[^\d]+/ /g;
@baz = split(' ',$bar);
print " ($foo) ($bar) (@baz) ($#baz)\n";

Note the space in the substitution for split to work on.  I'm still learning
this stuff so feel free to correct it.  

"There's more than one way to do it." :-)

-- 
Clark


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

Date: 02 May 1997 09:25:59 -0400
From: Clark Dorman <dorman@s3i.com>
Subject: Re: a question on striping characters
Message-Id: <dyb9yxaxk.fsf@s3i.com>



abigail@fnx.com (Abigail) writes:
> On 1 May 1997 18:44:51 GMT, Jeff Stampes wrote in comp.lang.perl.misc
> ++ 
> ++ spanky@direct.ca wrote:
> ++ : how can you strip the character string, Ex ->  "I_LIKE_THE_NUMBER_9"
> ++ : to get just the number 9?
> ++ 
> ++ By reading the perlfunc manpage and studying the substr() function,
> ++ or the perlre manpage and understanding how regular expressions
> ++ work.  Or you could see the FAQ, or read any perl book, or even
> ++ search Deja News.
> ++ 
> ++ $foo = "I_LIKE_THE_NUMBER_9"
> ++ $bar = substr($foo,-1,1);
> 
> This gets the last character of the string, regardless whether it's
> a number or not.
> 
> $foo = "I_LIKE_THE_NUMBER_9";
> $bar =~ s/[^\d]+//g;
> 
> strips out all non numbers.

1.  How does the substitution expression know to work on $foo?  It seems 
    that $_ is not being set to $foo. 
2.  The above mushes all the numbers into one big number.  Try:

#!/home/dorman/bin/perl -w

$bar = $foo = "I_LIKE_THE_NUMBER_9_AND_THE_NUMBER_12";
$bar =~ s/[^\d]+/ /g;
@baz = split(' ',$bar);
print " ($foo) ($bar) (@baz) ($#baz)\n";

Note the space in the substitution for split to work on.  I'm still learning
this stuff so feel free to correct it.  

:-)

-- 
Clark


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

Date: Fri, 2 May 1997 10:14:24 -0600
From: Russell_Schulz@locutus.ofB.ORG (Russell Schulz)
Subject: Re: a2p support redirection?
Message-Id: <19970502.101424.9p3.rnr.w164w@locutus.ofB.ORG>

  [
    "comp.lang.awk;" is not, nor will it ever be, a valid group.
    your software should have warned you of this!
  ]
    
mike.grondin@fidelity.com writes:

> When I ran the following minimalist code through a2p, I got a syntax
> error.  This seems to (me to) indicate that a2p does not support awk
> redirection.  Can you confirm?

> BEGIN   {       print "foo" > "foo"             }

I also can't get it to go with parenthesis
  { print ( var1 ) > var2; }

or anything else similar.

> OS:     Linux 3.0.3
>         perl 5....3

same on my NeXTstep 2.1, perl 5.003.  of course, a2p.y says it was
last modified in 1992.  (it actually says 92, so I'm theorizing here.)

> Any workarounds?

none that I know of.  I'll add it to the `a2p problems' section in
the comp.lang.awk FAQ.

the yacc code looks like it should handle this case, though.  if I
have gobs of free time I'll try to see where it's going wrong.

> Please reply snidely if this has been addressed in any FAQ.

now, now -- you've been reading c.l.p.m too long.
-- 
Russell_Schulz@locutus.ofB.ORG  Shad 86c


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

Date: 1 May 1997 13:57:05 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Best way to read from STDIN twice?
Message-Id: <5ka7fh$tun$1@dartvax.dartmouth.edu>


In article <877mhli37n.fsf@razumovsky.thecia.net>
Dan Schmidt <dfan@thecia.net> writes:

> What I'm wondering is, what is the approved way to read STDIN twice?
> The two straightforward things I could do are to 1) slurp the whole
> file into an array, but I'd like to not waste any more space than
> necessary, and 2) copy STDIN to a file, then operate on that, which
> seems wasteful, as much of the time STDIN may actually already be a
> file.

Well, you're going to have to do something...

How about forcing input to come from a file?  Then you know you'll
always be in the file case.

Chipmunk


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

Date: 3 May 1997 00:50:10 GMT
From: Pete Williams <petew@lexis-nexis.com>
Subject: Can I create a filehandle from socket descriptor?
Message-Id: <5ke242$o3i@mailgate.lexis-nexis.com>

I'm building an XSUB that calls a system routine which returns a _socket_
_descriptor_.  As I'd like to return a file/socket handle to the user, I
need to somehow associate this handle with the descriptor after the socket
has already been opened and setup.

Can I do this?

One way around this would be to dup the socket and then close the original. 
However, this would seem to leave me with the problem of using syscall to
do the close on the original socket descriptor, which I _really_ don't want
to do.

Can I use ties for this?   It seems that I'm going to have to do this in
the XS file itself, so that I can implement the read and write calls in
Perl.  Any hints?

TIA,

Pete Williams <petew@lexis-nexis.com>

-------------------------- SITUATION: Balky Mail ---------------------------
ADMINISTRATIVE FASCIST: Puts mail use policy in motd.  Locks accounts 
  that go over mail use quota.  Keeps quota low enough that people go 
  back to interoffice mail, thus solving problem.
  -- Stephan Zielinski "KNOW YOUR UNIX SYSTEM ADMINISTRATOR - A Field Guide"


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

Date: Fri, 2 May 1997 18:39:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Perry Frost <perry@perrylogic.com>
Subject: Re: capturing user info
Message-Id: <Pine.GSO.3.96.970502183840.5798F-100000@kelly.teleport.com>

On 1 May 1997, Perry Frost wrote:

> I am looking for a way to run a CGI script as a SSI when a visitor comes
> to a page. 

Uh-oh. This smells like a CGI question, not a Perl question. Maybe you
should check out a CGI newsgroup, or their FAQ. Good luck with your
project!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 2 May 1997 18:51:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bhasker Allam <abr@wasp>
Subject: Re: dbmopen fails.
Message-Id: <Pine.GSO.3.96.970502185025.5798K-100000@kelly.teleport.com>


On 1 May 1997, Bhasker Allam wrote:

> 	dbmopen(%DBARRAY, "addrdb", 0666) ||
> 			die "Cannot open data base: $!\n";
> 
> 	I get the following error:
> 
> 	AnyDBM_File doesn't define a TIEHASH method at dbcreate line 8

That means that your copy of Perl was installed without any database
support, if I'm not mistaken. You could get some database modules from
CPAN, or install a newer version of Perl. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 02 May 1997 16:55:36 -0700
From: "A. Mishra" <mishra.aditya@emeryworld.com>
Subject: File Descriptors
Message-Id: <336A7EF8.76DF@emeryworld.com>

Why can I open only 251 file descriptors with perl when the
system limit is 1024/process.Actually these descriptors happen
to be sockets.

I running perl on Sun Solaris 2.5.1

Any suggestion will be appreciated.

Thanks in advance


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

Date: Fri, 2 May 1997 18:15:25 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: kyzer@hotmail.com
Subject: Re: getting and derefencing in one go
Message-Id: <Pine.GSO.3.96.970502181101.5798B-100000@kelly.teleport.com>

On 2 May 1997, Kyzer wrote:

> sub myfunc {
>   return unless my $name = shift @_;
>   return unless my $hashref = shift @_;  # statement 1, get in ref arg
>   my %hashes = %$hashref;                # statement 2, convert ref to var
>   $name, ', I am kevin and I am ',%hashes{'kevin'},"\n";
> }
> 
> Now, what I would like to know is:
> Can I get arg2 in and dereferenced into %hashes with 1 statement,
> rather than 2?

Part of the gain provided by passing a reference is in not duplicating the
whole structure. That is, instead of making a whole new local hash
(expensive), consider simply dereferencing the reference. You can do that
by putting the reference inside curly braces in place of the name
('hashes') wherever it appears. 

    sub myfunc {
        return unless (my($name, $hashref) = @_) >= 2;
        $name, ', I am kevin and I am ', %{ $hashref }{kevin}, '\n";
    }

That dereference could also be written more simply like this. Many people
prefer this simpler form.

        $hashref->{kevin}

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 2 May 1997 18:48:29 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Timothy Lindgren <tim@regiononline.com>
Subject: Re: Hexadecimal  search and replace?
Message-Id: <Pine.GSO.3.96.970502184636.5798I-100000@kelly.teleport.com>


On 1 May 1997, Timothy Lindgren wrote:

> Can anyone help describe a routine that will open a file from command line, 
> then search for the bad hex value ( "0D0D0A" ) and replace it with the HEX 
> value of " 0D0A "?

Is this what you're looking for?

    perl -pi.bak -e 's/0x0d0d0a/0x0d0a/g' files*

> Is there a command/function in SED that would find these and replace
> them with a standard new-line (" \n ")? 

There probably is, but we Perl folks wouldn't know anything about that.
:-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 2 May 1997 18:21:45 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Magnus S|derstr|m MNF94 <masoders@news.abo.fi>
Subject: Re: Hostname
Message-Id: <Pine.GSO.3.96.970502181601.5798C-100000@kelly.teleport.com>

On 2 May 1997, Magnus S|derstr|m MNF94 wrote:

> 				I need to get the hostname of the computer that I am currently
> 				logged into. 

I suppose you don't want this. Funny, it works for me. :-)

     $hostname = 'localhost';

Seriously, there's no guaranteed way to do what you ask. The reason is
that the machine may have zero, one, two, or many different hostnames. But
you could start by seeing what the manpage for uname(1)  says that `uname
-n` will give you. 

If you're writing a CGI script, check the CGI interface specs, which may
give you what you need. But since that's not about Perl, I won't say more
about it here. In fact, except for my joke example, I haven't used any
Perl, which makes me wonder whether this is really a Unix question instead
of a Perl question. :-)

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 3 May 1997 04:44:41 GMT
From: jahwan@supernova.math.lsa.umich.edu (Jahwan Kim)
Subject: How plausible is it to make 'foo' in perl?
Message-Id: <slrn5mlglp.1kt.jahwan@supernova.math.lsa.umich.edu>

> This made me wonder, suddenly: can telnet be written in perl?
  Of course it can be written in Perl.  Now if you'd said nroff,
  that would be more challenging...   --Larry Wall
  
    I took the quote above found in Perl Language Homepage quite seriously,
and asked myself this question:  Can
(1) ucb utilities
(2) an editor
(3) an MUA (Mail User Agent)
(4) an MTA (Mail Transfer Agent)
(5) a (intelligent) news reader
(6) a web browser, text-only or graphic
(7) a spread sheet
(8) a word processor (OK, OK, I'll stop it here.)

be effectively written in Perl?  It'd be (somewhat) nice, e.g., if we have
a news reader written in Perl with Perl as its macro language.
    I must confess I'm quite new to Perl, but as far as I can see, there's
no obstacle to realize (3), (5), text (6).  Of course, I don't have much
experience with Perl in working.  
    Is Perl too slow to have (1)-(8) in Perl?
    
Full of curiosity,
Jahwan



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

Date: Fri, 2 May 1997 18:43:09 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kiran <dasoju@cnde.iastate.edu>
Subject: Re: how to compile and execute a program from perl
Message-Id: <Pine.GSO.3.96.970502184012.5798G-100000@kelly.teleport.com>

On Thu, 1 May 1997, Kiran wrote:

> i want to write a perl script which at times compiles and executes a
> program how can i do it

A university near you probably offers a course in compiler design. Hope
this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 2 May 1997 18:49:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Stefan <StefanEnd@NoSpam.DeathsDoor.com>
Subject: Re: Launching Cold Fusion URL from perl script
Message-Id: <Pine.GSO.3.96.970502184854.5798J-100000@kelly.teleport.com>

On Thu, 1 May 1997, Stefan wrote:

> I need to get a perl script to launch a URL and pass a few parameters
> on to it. 

Have you tried LWP? Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Sat, 03 May 1997 05:04:53 GMT
From: mark@ntr.net (Mark Mills)
Subject: Re: Loosing clpm regulars (was Re: Perl auto-replier)
Message-Id: <336ac6c7.2316369@news.ntr.net>

On 1 May 1997 11:08:19 GMT, I-hate-cyber-promo@man.ac.uk (A. Deckers)
wrote:

>>>I was wrong, twice, but I'm through with those mistakes.  I go now to
>>>join Larry in that great Perl heaven far removed from Usenet.
>
>What do you think? Perhaps if we can create a group with a high signal to
>noise ration, we can bring back some of the people like Tom, and who
>knows, maybe Larry, who make these newsgroups really worthwhile.
>
>Alain

$robomoderate++;
$autofaq++;


-- 
[Hopper, Dennis]: There's mines over there, there's mines over 
there, and watch out those goddam monkeys bite, I'll tell ya.
==Apocalypse Now==


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

Date: 02 May 1997 20:49:48 -0400
From: Jay Rogers <jay@rgrs.com>
To: Luca Passani <lpa@sysdeco.no>
Subject: Re: Network Programming and Sockets
Message-Id: <82207pz8er.fsf@shell2.shore.net>

Luca Passani <lpa@sysdeco.no> writes:

> 1) wouldn't it be possible for Perl to offer some higher-level interface
> to TCP/IP (even Socket.pm requires a rather deep understanding of 
> C/TCP/IP stuff)

Yes, it's called IO::Socket.  You can get and install it now or wait
and it will come standard in the next version of Perl (5.004).

For an even higher-level interface you can use Net::Telnet which
inherits from IO::Socket::INET.  It allows you to make client
connections to TCP services, to wait for certain patterns to appear,
and to read and write using a timeout.

--
Jay Rogers


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

Date: Fri, 02 May 1997 22:10:19 -0400
From: Bill Cowan <billc@tibinc.com>
To: "William E. Jens" <WJens@pagepath.com>
Subject: Re: ODBC & Perl
Message-Id: <336A9E8B.678E@tibinc.com>

There was a similar question recently in Win32 Perl mailing list and a
caution about aggregates and expression in SELECT list. Please see that
message.

Here is example with result column name (i.e. column names for
aggregates) and code that puts the column values back into Perl
variables (@Data or %ColumnsInHash).

Bill

my  $Sql = <<__END_OF_HERE_DOC__;
SELECT TypeOfTable = type,
       MinRowName  = min(name),
       CountOfRows = count(*)
FROM sysobjects
group by type
__END_OF_HERE_DOC__
if ($rc = $db->Sql($Sql)) {
    $db->DumpError;
}
print "Running Step #3...\n";
print "List of Field Names: ", join(',', $db->FieldNames()), "|\n";
print "Listing of Rows:\n";
while ($db->FetchRow()) {

    @data = $db->Data();  # columns in row placed in array.

    # another other option is to return columns as a hash
    # where hash key is column name and hash value is column's value
    #   %ColumnsInHash = $db->DataHash();

    print join(',', @data), "|\n";
}

William E. Jens wrote:
> 
> Given the following Perl/ODBC call, how do I get the data back into my
> variables?
> 
> $stmt = "select field1, min(field2), max(field2) from table1 group by
> field1";
> 
> $db->Sql("$stmt");
> while ( $db->FetchRow() ) {
>     $db->Data() -- What does this statement look like?
> }
> 
> I've looked for examples, but I haven't found any that deal with
> returning rows while using aggregate functions.
> 
> --
================= Win32 Mailing List ==========================

When you have aggregates (or expressions) in SELECT statement as in,

        SELECT name, address, sum(income), sum(balance) ...

there is no column name associated with aggregates (or expression
result).
Sometimes called "result column". I think that is why you are having
this
problem. Probably needs a caution in the doc about aggregates for Data()
and FieldName() methods.

The workaround is to provide the column name:

    SELECT name,
           address,
           income_total = sum(income),
           account_balance = sum(balance) ...

Check your SQL doc; some databases use a different syntax:

    SELECT name,
           address,
           sum(income) AS income_total, ...
                      ^^^^
> ...or am I doing something wrong?
>
>    @data = $db->Data();
>
> returns the right data for SQL statements without aggregates
> in the SELECT clause.  But with
>
>    SELECT name, address, sum(income), sum(balance) ...
>
> $db->Data() returns four elements as if the query had been
>
>    SELECT name, address, sum(balance), sum(balance) ...
>
> I'm using NT, SQL Server, Perl 304, ODBC.pm 970208.  If I run
> the SQL directly against the database using isql without any
> Perl stuff, I get the right answer.


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

Date: 3 May 1997 05:10:23 GMT
From: maclaudi@cps.msu.edu (Claudia  Ma)
Subject: Pattern Match Question
Message-Id: <5kehbv$3bq$1@msunews.cl.msu.edu>

Hi there,

Can someone tell me how to get rid of special chars like !, #, (, .. ?

I used 

$var =~ /\!+|\#+\\(+//g;

but it didn't work. :(

Thanks!

-Claudia


--
============================================================
Claudia Y. Ma, Computer Science Dept., MSU
Email: maclaudi@cps.msu.edu
URL: http://www.cps.msu.edu/~maclaudi
============================================================


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

Date: Fri, 2 May 1997 18:46:02 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: TempStephenByrne@extonpo.bentley.com
Subject: Re: Perl and fixing dynamic URLS
Message-Id: <Pine.GSO.3.96.970502184348.5798H-100000@kelly.teleport.com>

On Thu, 1 May 1997 TempStephenByrne@extonpo.bentley.com wrote:

> I am looking for some more help with Regular Expressions as they
> relate to URLS.

A URL is text, and a regular expression operates on text, so that's their
relationship. :-)

> I have a file that I "sucked" down that is called the following:
> "./SELECT_cgi/owa/SOLS.VaultDetail?Application=Engineering+Links%3CSUP%3ET
> M%3C/SUP>&PlatformName=Intel(R)+and+compatible+PCs+running+Windows+95"
> 
> What I want to do is extract the Application Name and Platform name from
> this filename.  It seems easy, but some reason I am having a hard time
> with it.

Did you write a regular expression, and did it work? Here's an idea: I'd
try matching this in separate steps, since either PlatformName=foo or
Application=bar might come first, probably. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 3 May 1997 02:42:51 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: PERL Editor
Message-Id: <5ke8nb$ufj@news.microsoft.com>

In article <5kdhii$q64@info.abdn.ac.uk>, junkmail@sysc.abdn.ac.uk says...
>
>Luigi Mattera, while sobering up, wrote:
>: Peter G. Martin (peterm@zeta.org.au) wrote:
>: : emacs.pl, potatoes, vi, ed....
>: : So none of you own a pencil, huh ?
>
>:   Pencils?  Bah, who needs pencils?  You should manually punch out
>: holes in punch cards to feed into a punch card reader.
>
>All that card? I only need 8 switches and a button to input *my* programs.

switches? really? I use wire jumpers ;-)
-- 



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

Date: 3 May 1997 04:31:44 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: perl5 & gdbm on different platforms
Message-Id: <5kef3g$h5u@vixen.cso.uiuc.edu>

Bill Dell (wdell@ptc.com) wrote:
: Hi all
: 
: I've run into a problem with a current project i'm working on and
: i'm unclear as to why it isn't working as it should.
: 
: I have perl5 compiled over IRIX 6.2 and OSF/1 4.0 linked with
: gdbm. When I create a tied hash DB (with GDBM_File) on irix, I can't
: access this same data on the OSF/alpha. Shouldn't the DB be readable
: at least regardless of platform? Or is this not at all a possibility?
: 
: using:
: 	Perl 5.003
: 	gdbm-1.7.3
: 

With the exception of DB_File, all DBMs supported by perl are
byte-order dependent. Furthermore, they may not be compatible
even if both platforms are big-endian or little-endian, as default
integer sizes can be different.

Use DB_File (aka Berkeley DB) if you need platform-independence.

-- 
Regards,                                                      ___       ___
Mike Heins     [mailed and posted]  http://www.iac.net/~mikeh|_ _|____ |_ _|
                                    Internet Robotics         | ||  _ \ | |
This post reflects the              Oxford, OH  45056         | || |_) || | 
opinion of my employer.             <mikeh@iac.net>          |___|  _ <|___|
                                    513.523.7621 FAX 7501        |_| \_\   


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

Date: 2 May 1997 21:48:42 GMT
From: a-bnc@microsoft.com (Nicholas Carey)
Subject: Re: pre-RFD: comp.lang.perl.{data-structure,inter-process,porters,regex}
Message-Id: <5kdnfq$g8b@news.microsoft.com>

In article <1997Apr28.161957.14036@schbbs.mot.com>, 
appleton@nospam.northbrook.aieg.mot.com says...

> > 1- whether the proposed additional groups are well chosen,
> > and if not, what the alternatives should be;
>
> I like them, but I think there should be a separate group
> expressly for newbie questions. So clueless perl newbies who
> havent the first idea which of the above groups to post to will
> plainly see where to send their hapless questions. Using
> c.l.p.misc as a catch-all is fine but I think this particular
> group of people will merit its own newsgroup (and make the rest
> of us much happier).

  [SNIP]

> > 5- whether it is worth going to the trouble of setting up
> > clp.porters, or if this will generate more costs than
> > benefits. Since I don't participate on the porters mailing
> > list (though I occasionally read the gated newsgroup), I
> > will bow to whatever prevailing opinion emerges among
> > those who do.

It's probably not worth setting up clp.clueless.newbie for
the simple reason that [almost] nobody will post to it.

Clueless.Newbies won't post to it because, "my problem is
obviously far too [complex|important] to *be* a newbie problem.
So, I'll just post my message to...well, let's see...the entire
clp.* hierarchy. That way, somebody will be sure to answer it."

And just who *would* read clp.clueless.newbies? How many people
are going to read a group to do nothing but post articles whose
body consists of something along the lines of

  Did you read the documentation? It's in the perl manpages,
  and the FAQ covers it in section 10.7.2 "How do I use an
  asterisk '*' character as a part of a regex pattern?

And as far as clp.[wizards|porters|etc] go, these groups would
be an absolute magnet for inane questions. Again, the newbie
mindset: "My problem is far, far too complex for mere mortals.
Only a wizard or Larry Wall hisself can comprehend the subtle
complexities inherent in this problem."

In addtion, clp.porters newsgroup would almost certainly need
to be moderated to keep the S/N ratio sufficiently high. And
moderation would reduce its utility by (I suspect) an order of
magnitude or so.

I lurk on the p5p list...there is a lot of traffic (75-150
message/day!). A lot of the discussion on p5p is pretty
rapidfire discussion. I've seen bugs reported that are
reproduced and verified on several different platforms
within an hour or so. A patch put out shortly after that. And
the patch being installed, tested and verified within another
small window. That sort of quasi-realtime conferencing doesn't
work very well in the NNTP world, because of the propagation
delays.

Decomposition by skill/experience level doesn't work very well.

N.
-- 
I'll be extremely surprised if the opinions expressed in this message
are those of the Microsoft Corporation. They make me say that. If I
am speaking for Microsoft, they'd better give me raise!



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

Date: Fri, 02 May 1997 00:41:32 -0500
From: Steven Headley <sheadley@cyberramp.net>
Subject: problems receiving lines from modem
Message-Id: <33697E8C.2A4E@cyberramp.net>

Hi all,
   I am having a couple of problems with a script I am trying to write
that enable me to dial out and print the output received by the modem to
STDOUT.

1) I can't seem to flush the last line out of $_. It justs stays in the
buffer until I turn off the modem, and then I see a printout on the
screen.

2) Sometimes these AT commands work sometime they don't.

$com="+< /dev/cua1";
open(COMPORT,$com) || die "Can't open comm port $!";
select((select(COMPORT), $! = 1)[0]);
sleep 1;
print COMPORT "ATZ\r\n";
sleep 1;
print COMPORT "ATS11=50\r\n";
sleep 1;
print COMPORT "ATDT222-222-2222\r\n";
while(<COMPORT>) {
    print $_;
}

Any help would be appreciated.



    Steven Headley.


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

Date: Fri, 2 May 1997 18:25:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Luca Passani <lpa@sysdeco.no>
Subject: Re: problems with the debugger
Message-Id: <Pine.GSO.3.96.970502182259.5798D-100000@kelly.teleport.com>

On Fri, 2 May 1997, Luca Passani wrote:

> Every time I start the debugger I get all of these messages, even though
> everyhting seems to work OK afterwards. 

It looks like the usual noise from the debugger, but it goes on an awful
lot longer than usual. What version of Perl are you using? (The beta for
5.004 is supposed to be much quieter when it starts the debugger.) Does it
still happen when you install a more recent version?

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 2 May 1997 17:57:01 -0700
From: erisson@kallisti.sw-tech.com (E.)
Subject: Re: program for perl?
Message-Id: <slrn5ml3ae.o54.erisson@kallisti.sw-tech.com>

Craig Berry <cberry@cinenet.net> wrote:
> E. (erisson@kallisti.sw-tech.com) wrote:
> : Randal Schwartz <merlyn@stonehenge.com> wrote:
> : > 
> : > 	$ cat >myscript
> : > 	...
> : > 	[runs perfectly]
> : 
> : Showoff.  :P
> 
> To me, the most impressive part is how the script runs perfectly without 
> his ever having actually invoked it. :)

He did.  I snipped it.

-E (who THOUGHT it would be obvious)

-- 
PGP Public Key Fingerprint: BE FC C5 FB 30 47 E5 5C  DC DF C3 C0 AD A5 27 17
Homepage: http://www.primenet.com/~fnargle/erisson/   PGP Key available here
"I am free of all prejudice.  I hate everyone equally." -W. C. Fields
"I hate quotations." -Ralph Waldo Emerson


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

Date: Sat, 03 May 1997 03:33:20 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: Q on:   map { @M=$_=~/(\S+)/g && [$_, $M[$col]]  } @in;
Message-Id: <336ab0ac.156926037@news.seanet.com>

On Fri, 02 May 1997 10:21:13 +0100, Jong <jong@mrc-lmb.cam.ac.uk>
wrote:

>Hi,
>
>I am making a subroutine which uses map to sort
>things in any column given.
>The map function part above does not seem to produce
>array and put it to next level 
>&& [$_, $M[$col]]
>
>The whole line is:
>
>$col=2;
>
>@out= map {$_->[0]} sort { $a->[1] <=> $b->[1] } map {@M=$_=~/(\S+)/g &&
>[$_, $M[$col]]  } @in;

hm... probably something really obvious.  In any case, looks like your
map is just splitting on whitespace.  So you might want to try
something like this instead:

@out = ... ... ... map {[$_, (split)[$col]]} @in;

hth


-- Tim Gim Yee             tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"


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

Date: 2 May 1997 23:46:47 GMT
From: tommy@best.com (Tom Vaughan)
Subject: scalar holds compiled code
Message-Id: <5kdud7$49l$1@nntp1.ba.best.com>



Given:

$STUFF = <<'END_OF_STUFF';
[compiled code here]
END_OF_STUFF

$STUFF is a binary file which has been inserted into the perl script.
How do I execute what $STUFF holds? Is this possible?

--
Tom Vaughan <tommy@best.com>


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

Date: Fri, 2 May 1997 18:37:40 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Jete Software Inc." <jete@dgs.dgsys.com>
Subject: Re: Why no regex char class for punc chars???
Message-Id: <Pine.GSO.3.96.970502183438.5798E-100000@kelly.teleport.com>


On 1 May 1997, Jete Software Inc. wrote:

> I was wondering why there is no regular express character class
> for punctuation characters?? or is there one and i am just unaware
> of it. I looked through the Camel 5 book and couldn't find it.
> 
> This would work the same way that \w does (for [a-zA-Z_0-9])

Perhaps you want \W ?

> This way I can easily check for these characters without having
> to worry about meta-characters screwing things up. 

Hmmm... If you're worried about metacharacters, use quotemeta and
backwhack them all. Don't take any chances! :-)  But if you're doing
something with security aspects, don't ask yourself what to filter out,
because you might forget something crucial. The real question there is,
what is safe to permit? That way, you'll never get any characters you're
not ready to deal with.

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

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

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