[6411] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 36 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 2 09:07:14 1997

Date: Sun, 2 Mar 97 06:00:26 -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           Sun, 2 Mar 1997     Volume: 8 Number: 36

Today's topics:
     advice needed (kent)
     Re: Assigning value to scalar with regular expression (Tad McClellan)
     Re: can $_ be dissociated from its contents? (Brian L. Matthews)
     Re: ftp site to download PERL5x for Win95??? plez!! (Nathan V. Patwardhan)
     Re: Grabbing text of web pages using perl (gbones)
     MALAKAS (was: MAKE CASH FAST) (Charidemos Gortynios)
     New download page / 3900+ links about Object-Orientatio <manfred.schneider@rhein-neckar.de>
     NT/95 Registry <drwill@loginet.com>
     Re: NT/95 Registry (Nathan V. Patwardhan)
     PerlIS+Win32::ODBC - Can't call method "Sql"... (Dirk Leas)
     Re: PerlIS+Win32::ODBC - Can't call method "Sql"... (Nathan V. Patwardhan)
     Re: Please Respond (John Stanley)
     Re: Socket/Spawn problems under Solaris - appears to be (Gideon King)
     Socket/Spawn problems under Solaris - could someone tes (Gideon King)
     Re: sort by multiple keys? (Andrew M. Langmead)
     Re: WANTED: BBEdit Tips and Tricks (ook!@ook.org)
     Re: WANTED: BBEdit Tips and Tricks (Cari D. Burstein)
     What's wrong with this Perl? (Tim Dierks)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Fri, 28 Feb 1997 00:48:17 GMT
From: kc079@mdx.ac.uk (kent)
Subject: advice needed
Message-Id: <5f4dia$466$1@seva.mdx.ac.uk>


	I am doing a research with the title "How Perl scripting makes a Web
page interactive ?" and I need some advices from you all.

1) The O/S environment I am working with is Unix, do I need a server
to run the Perl script ? Can I run it on my PC ?

2) Which editor in Unix should I use for writing Perl script ?

3) What else do I  need and know in order to do the research ?

Please advise and thanks in advace.

kent.




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

Date: Sat, 1 Mar 1997 23:38:12 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Assigning value to scalar with regular expression
Message-Id: <4o3bf5.dc3.ln@localhost>

Fritz (fritz@fuse.net) wrote:
: I've taken an intro to Perl class, read through the Llamma book, and
: briefed through the Camel book, 

Your list is missing the perlre and perlop man pages.


: but there is still something I don't
: quite get.  Is there any way to directly assign a value to a scalar
: based on a match of a regular expression.  For example, what I THINK I
: want to do is the following, but it doesn't work:

: $_ = '"WantThis"    VAR="Whatever"';
: $myvar =~ /[^"]\w+[^"]/;
         ^^
         ^^

This does pattern match binding (not assignment). So you are telling
perl to try and match against the contents of $myvar. What's
in $myvar?  (likely undef or empty string?).  I'd guess you really
want it to try and match against the contents of $_?


You need a different regex. But you haven't told us what you
want to match in enough detail for us to write one...

1) the first double quoted thing?
2) the longest double quoted thing?
3) a double quoted thing, but only if it is the first thing
   on the line?
 ...



: print $&, "\n";

I very rarely use the special variables for matched patterns (just
a style issue I suppose). I can always do what I want by triggering
memory with parenthesis in the regex, and using the positional
variables.


: I know my regular expression works ($& prints ok), but I don't get
: anything in $myvar.  Other than adding an extra line to set $myvar = $&,
: is there no way to get this assignment to work?  I don't understand what
: is/isn't going on with the =~.
                         ^^^^^^

As above, it is telling which perl to use as the source string to search.


: In the same vein and based on an example in the Llamma book, I would
                                ^^^^^^^^^^

Which example?


: have thought the following would work, but it doesn't:

: $_ = '"WantThis"    VAR="Whatever"';
: ($myvar) = /[^"](\w+)[^"]/;
: print $&, "\n";

: Confused...


Hope one of these examples will help:

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

$_ = '"WantThis"    VAR="Whatever"';

($myvar = $_) =~ s/"(\w+)".*/$1/; # copy to myvar, then substitute out
                                  # the parts you don't want
print "$myvar\n";

$myvar = $1 if /(\w+)/;           # match a word
print "$myvar\n";

$myvar = $1 if /"(\w+)"/;         # match a word only if it is double quoted
print "$myvar\n";

$myvar = $& if /[^"](\w+)[^"]/;   # w/ your regex, all on one line
print "$myvar\n";


# your regex doesn't require matching double quote char at
# _any_ point. So note what you get from this one...

$_ = '<a href="WantThis">';

$myvar = $& if /[^"](\w+)[^"]/;   # w/ your regex, all on one line
print "$myvar\n";
-------------------


It is often a good approach to write a pattern for what you _do_
want to see (double quote) rather than what you _don't_ want to
see (any char except double quote)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 1 Mar 1997 22:52:06 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: can $_ be dissociated from its contents?
Message-Id: <5fb82m$ool$1@halcyon.com>

In article <3317D833.5956@egames.com>,
Devin Ben-Hur  <dbenhur@egames.com> wrote:
|Rahul Dhesi wrote:
|>    push(@::ARRAY, \$_);
|>    $_ = 'something else';
|> the reference pushed onto @::ARRAY points
|> towards the current $_, and not towards original data that $_ contained.
|Perhaps you need a newer version of Perl, or you did something 
|odd in your experiment.  This code:
|foreach (qw(one two three)) {
|    push @a, \$_;
|}
|$_ = "junk";
|print join(':', map($$_,@a));
|prints:
|  one:two:three

No. Your code is fundamentally different from Rahul's in that it is
pushing a reference to a $_ implicitly localized by the foreach.
Try replacing the foreach with:

$_ = 'one'; push @a, \$_;
$_ = 'two'; push @a, \$_;
$_ = 'three'; push @a, \$_;

Of course, this may suggest a solution to Rahul's problem--push a
reference to a lexically scoped variable (my $x) instead of a global
one ($_). Or maybe not.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: 2 Mar 1997 04:42:25 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: ftp site to download PERL5x for Win95??? plez!!
Message-Id: <5fb0fh$92v@fridge-nf0.shore.net>

kamila (ksf2@cornell.edu) wrote:
: Can someone plez tell me where can I find the binary file
: for PERL5x for Windows95.  

http://www.activeware.com

Get perl5.003_07, called pw32i303.exe

HTH!

--
Nathan V. Patwardhan
nvp@shore.net
"What is your favorite color?
Blue ... I mean yellow ... aieeeee!
	--From the Holy Grail"


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

Date: 2 Mar 1997 06:31:18 GMT
From: glee@glee.com (gbones)
Subject: Re: Grabbing text of web pages using perl
Message-Id: <glee-0203970139040001@nyc-ny27-21.ix.netcom.com>

In article <5f7fjf$ko2@lastactionhero.rs.itd.umich.edu>,
hutchin@news-server.engin.umich.edu (Timothy B. Hutchinson) wrote:

Is there a relatively easy way -- or a publicly available script --
which would allow me to grab the text of a web page and append it 
to a file?  In other words, the input for a filehandle would be the
web page -- is this possible?

Thanks!

Tim Hutchinson

I just spent the last week fiddling with various scripts/socket calls, and
i finally found a script here :

http://www-step.ucsd.edu:80/step/s96/perl/sockets/


good luck!


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

Date: Sun, 02 Mar 1997 12:57:16 +0200
From: vicenzos@cornaros.gr (Charidemos Gortynios)
Subject: MALAKAS (was: MAKE CASH FAST)
Message-Id: <vicenzos-0203971257160001@194.30.208.32>

In article <5enprl$nd7$381@news.hol.gr>, giorgos@hotmail.com (Giorgos
Stagakis) wrote:


> 
>    #5 Giorgos Stagakis
>       M. Renieri 1
>       73100
>       Chania, Crete, Greece
> 
>

The real e-mail address of this MALAKAS is: stilian@hol.gr
and his postmaster: postmaster@hol.gr


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

Date: 2 Mar 1997 11:15:14 GMT
From: "Manfred Schneider" <manfred.schneider@rhein-neckar.de>
Subject: New download page / 3900+ links about Object-Orientation
Message-Id: <01bc26fa$c8012910$b259c5c1@cetus>


Subject:        Collection of 3900+ links about Object-Orientation
Newsgroups:     Some comp.* newsgroups related to OO 
Reply-To:       manfred.schneider@rhein-neckar.de (Manfred Schneider)
Summary:        Topics and URLs of Cetus Links
Posting-Freq.:  Monthly
Organization:   Private Site

Hello,

are you interested in a collection of more than 3900 links
about Object-Orientation? 

No ads, few graphics, fast and free access!

New page "Download". Copy the Cetus Links to your hard disk and
browse them locally. File size: 300 KB, formats: zip and tar.gz

Main topics of the collection are:

   o   General Information and Links

   o   Distributed Objects, Business Objects, Object Request Brokers,
       ActiveX/OLE, Corba, JavaBeans/RMI, OpenDoc

   o   OOA/OOD Methods and Tools, Diagram Layout

   o   Languages, Ada, C++, Delphi, Eiffel, Java, JavaScript, 
       Modula-3, Oberon, Objective-C, Perl, Python, Sather, 
       Smalltalk, Tcl/Tk, VBScript, Visual Basic, Visual C++

   o   Databases, OO DBMS, OR DBMS, OR Mapping
   o   Patterns, Libraries, Frameworks
   o   Metrics, Reuse, Testing, Numerics
   o   Services and Companies

The collection runs on a server in Heidelberg, Germany.
Mirrors are available for faster access from other countries.

URL of original site:
   o   http://www.rhein-neckar.de/~cetus/software.html

URLs of mirror sites:
   o   Australia, Melbourne
       http://www.csse.swin.edu.au/manfred/software.html

   o   Austria, Vienna  
       http://www.infosys.tuwien.ac.at/cetus/software.html

   o   Brazil, RS, Porto Alegre
       http://www.intuitive.com.br/cetus/software.html

   o   Japan, Osaka  
       http://aries.ise.eng.osaka-u.ac.jp/cetus/software.html

   o   USA, IL, Chicago
       http://www.objenv.com/cetus/software.html

   o   USA, UT, Provo
       http://mini.net/cetus/software.html

I hope you will find the Cetus Links useful. 

Please feel free to send suggestions, comments, new or changed URLs.

Manfred




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

Date: 2 Mar 1997 05:19:47 GMT
From: "David Williamson" <drwill@loginet.com>
Subject: NT/95 Registry
Message-Id: <01bc26c9$72f6f340$184281ce@zonetemp.dns.microsoft.com>

Anyone know how to access (add/delete keys) the Win 95/NT registry from a
PERL script?

David R. Williamson


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

Date: 2 Mar 1997 07:20:21 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: NT/95 Registry
Message-Id: <5fb9nl$l3i@fridge-nf0.shore.net>

David Williamson (drwill@loginet.com) wrote:
: Anyone know how to access (add/delete keys) the Win 95/NT registry from a
: PERL script?

I believe this is documented in the NTPerl API/README that was included
was included with your distribution of NTPerl 5.003_07.  If not, they
should have some examples at http://www.activeware.com

--
Nathan V. Patwardhan
nvp@shore.net
"Hello, good citizen.  I'm Batman.
Would you like to be my assistant?
Would you like to ride with me?
Would you like to ride with Batman?"


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

Date: Sun, 02 Mar 1997 05:16:46 GMT
From: dirkl@midak.com (Dirk Leas)
Subject: PerlIS+Win32::ODBC - Can't call method "Sql"...
Message-Id: <33190c1c.6646807@207.126.101.80>

I have a simple script that executes fine under perl.exe, but under
perlIS I get the error:  "Can't call method "Sql" without a package or
object reference at c:\work\scripts\getCourseList.pl line 15.".

I've checked the FAQ, but still a newbie, so be gentle ; - )

Adios,
Dirk


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

Date: 2 Mar 1997 07:18:54 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: PerlIS+Win32::ODBC - Can't call method "Sql"...
Message-Id: <5fb9ku$l3i@fridge-nf0.shore.net>

Dirk Leas (dirkl@midak.com) wrote:
: I have a simple script that executes fine under perl.exe, but under
: perlIS I get the error:  "Can't call method "Sql" without a package or
: object reference at c:\work\scripts\getCourseList.pl line 15.".

Good, descript subject line - excellent.  :-)

I hate to seem rude, but could you attach some code when posting in the 
future?  It would really help us detect where your problem is.

--
Nathan V. Patwardhan
nvp@shore.net
"Hello, good citizen.  I'm Batman.
Would you like to be my assistant?
Would you like to ride with me?
Would you like to ride with Batman?"


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

Date: 2 Mar 1997 06:21:51 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Please Respond
Message-Id: <5fb69v$h8q@news.orst.edu>

In article <33186BD7.1FD5@ix.netcom.com>,
Scott Green  <mogreen@ix.netcom.com> wrote:
>Would somebody please look at this and tell me what is wrong?

Ok. Let's start a list 

1. Rotten Subject: header on article asking other people to spend their
time helping you. Most people would skip this article. You asked for a
response, though, so you are getting one.

>#! /usr/local/bin/perl

2. Missing -w 

3. Missing "use strict;"

>if ($ENV{'HTTP_REFERER'} ne 'www.mydomain.com')
>
> {
>	print <<"HTML";
>     <HTML>
>     <HEAD>
>     <TITLE>Illegal</TITLE>
>     </HEAD>
>     <BODY>
>     <H1> User Unauthorized <H1>
>	<br>
>	
>	Sorry, but this server has no permissions to access this script.
>     </BODY>
>     </HTML>
>
>HTML
>
>     exit;
>}

I find nothing wrong with this code. I run it and it prints exactly
what you have told it to. I set the environment variable you are
testing, and nothing is printed. Or maybe this is problem ...

4. Failure to explain WHAT your think is broken or what you want your
code to do that it does not. Failure to explain the context your program
is running in.

5. Failure to ask your question in the correct venue. This perl code
runs fine. It ain't a perl problem. Your answer is probably in a CGI
group.

>Thank You, you can email me at mogreen@ix.netcom.com if you have any
>solutions.

6. If you are going to ask people to spend their time helping you, you
can spend a few minutes of your time reading the newsgroup. If you have
read the FAQ and not found an answer, it is possible that whatever is
wrong with your code is something someone else might need help with,
too. 

You DID read the FAQ, didn't you?

6a. If you want private consulting, be ready to pay for it.



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

Date: 2 Mar 1997 05:33:48 GMT
From: gideon@csarc.otago.ac.nz (Gideon King)
Subject: Re: Socket/Spawn problems under Solaris - appears to be spawn/reap problem
Message-Id: <5fb3fs$d2e$1@celebrian.otago.ac.nz>

I have looked at this a bit more and it appears to be a problem with the  
spawn/reap process. I took out all the sockets code and left a thing that  
just tried to spawn and reap 5 processes, and I got the "reaped -1 with  
exit 4" message. Can someone think of a good way to narrow this down to  
something more specific?

---
 
 Gideon King                    | Phone +64-3-479 9017
 Senior Software Engineer       | Fax   +64-3-479 8529
 The Black Albatross            |
 University of Otago            |
 Computer Science Applied       | e-mail gideon@csarc.otago.ac.nz
          Research Centre       | NeXT mail, MIME ok. PGP key available.
 Department of Computer Science |
 P.O. Box 56                    | I don't have a solution
 Dunedin                        |         but I admire the problem.   
 New Zealand                    |
 WWW access: http://www.csarc.otago.ac.nz:805/



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

Date: 2 Mar 1997 04:50:12 GMT
From: gideon@csarc.otago.ac.nz (Gideon King)
Subject: Socket/Spawn problems under Solaris - could someone test this for me?
Message-Id: <5fb0u4$67d$1@celebrian.otago.ac.nz>

I'm having problems with perl sockets on a Solaris machine (I have tested  
it on other unix machines and it works). I have narrowed is down to using  
simple example code available on the web. I have a Client process and a  
Server process. The client connects to the server, and returns the local  
time from the server. The bug exhibits itself whether you connect locally  
or from a remote host.

Description of EXPECTED behaviour:

	Client: 
Hello there, localhost, it's now Sat Mar  1 20:27:19 1997
	
	Server: 
StdServer.pl 17339: server started on port 2345 at Sat Mar  1 20:25:52  
1997
StdServer.pl 17339: connection from localhost [ 127.0.0.1 ] 
            at port 43840 at Sat Mar  1 20:27:19 1997
StdServer.pl 17339: begat 17386 at Sat Mar  1 20:27:19 1997
StdServer.pl 17339: reaped 17386 with exit 256 at Sat Mar  1 20:27:19 1997

Description of OBSERVED behaviour:

First connection, server does the begat, then the reaped, then:
StdServer.pl 17339: reaped -1 with exit 4 at Sat Mar  1 20:27:19 1997
The client gets the expected response.

Second connection, the client gets no response, but no errors either. The  
server does not pick up the fact that a client has tried to connect.

Third connection - as for first connection.

Fourth connection - as for second connection, etc.

This server behaviour is the same whether I run the client on the local  
machine, or on a machine where the client/server pair does work (a  
different version of unix).

What I'm looking for:

A volunteer to run the code below on a Solaris machine with perl 5.002 or  
5.003 installed on it (I've tested with both), and tell me the results. I  
have also observed some other oddities with my program when it is running  
under solaris, so I'm trying to sort this one out first, and if it works  
happily for someone else, perhaps something is going wrong during building  
or running perl (I suspect there may be some old SunOS libraries lying  
around, and I hope they are not getting used instead of the new Solaris  
ones).

If you have the time to do this for me, please email me the results.  
Thanks.

############################## Client ###########################
#!/usr/local/bin/perl -w
require 5.002;
use Socket;
my ($remote,$port, $iaddr, $paddr, $proto, $line);
$remote = "localhost";
$port = 2345;  # random port
$proto   = getprotobyname('tcp');

$iaddr   = inet_aton($remote) || die "Client->Server: no host $remote";

$paddr = sockaddr_in($port, $iaddr);

socket(SOCK, PF_INET, SOCK_STREAM, $proto) || die "Client->Server: socket  
$!";
connect(SOCK, $paddr);
while ($line = <SOCK>) {
    print $line;
} 
close (SOCK)            || die "close: $!";
exit;


###################### Server ###########################
#!/usr/local/bin/perl
require 5.002;
use strict;
BEGIN { $ENV{PATH} = '/usr/ucb:/bin' }
use Socket;
use Carp;
sub spawn;  # forward declaration
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" } 
my $port = shift || 2345;
my $proto = getprotobyname('tcp');
socket(SERVER, PF_INET, SOCK_STREAM, $proto)        || die "socket: $!";
setsockopt(SERVER, SOL_SOCKET, SO_REUSEADDR, 1)     || die "setsockopt:  
$!";
bind(SERVER, sockaddr_in($port, INADDR_ANY))        || die "bind: $!";
listen(SERVER,5)                                    || die "listen: $!";
logmsg "server started on port $port";
my $waitedpid = 0;
my $paddr;
sub REAPER { 
    $SIG{CHLD} = \&REAPER;  # loathe sysV
    $waitedpid = wait;
    logmsg "reaped $waitedpid" . ($? ? " with exit $?" : '');
}
$SIG{CHLD} = \&REAPER;
for ( $waitedpid = 0; 
      ($paddr = accept(CLIENT,SERVER)) || $waitedpid; 
      $waitedpid = 0, close CLIENT) 
{
    next if $waitedpid;
    my($port,$iaddr) = sockaddr_in($paddr);
    my $name = gethostbyaddr($iaddr,AF_INET);
    logmsg "connection from $name [", 
            inet_ntoa($iaddr), "] 
            at port $port";
    spawn sub { 
        print "Hello there, $name, it's now ", scalar localtime, "\n";
    };
} 
sub spawn {
    my $coderef = shift;
    unless (@_ == 0 && $coderef && ref($coderef) eq 'CODE') { 
        confess "usage: spawn CODEREF";
    }
    my $pid;
    if (!defined($pid = fork)) {
        logmsg "cannot fork: $!";
        return;
    } elsif ($pid) {
        logmsg "begat $pid";
        return; # i'm the parent
    }
    # else i'm the child -- go spawn
    open(STDIN,  "<&CLIENT")   || die "can't dup client to stdin";
    open(STDOUT, ">&CLIENT")   || die "can't dup client to stdout";
    ## open(STDERR, ">&STDOUT") || die "can't dup stdout to stderr";
    exit &$coderef();
} 
####################### End #########################
---

Gideon King                    | Phone +64-3-479 9017
Senior Software Engineer       | Fax   +64-3-479 8529
The Black Albatross            |
University of Otago            |
Computer Science Applied       | e-mail gideon@csarc.otago.ac.nz
         Research Centre       | NeXT mail, MIME ok. PGP key available.
Department of Computer Science |
P.O. Box 56                    | I don't have a solution
Dunedin                        |         but I admire the problem.   
New Zealand                    |
WWW access: http://www.csarc.otago.ac.nz:805/


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

Date: Sun, 2 Mar 1997 13:52:17 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: sort by multiple keys?
Message-Id: <E6F575.AI8@world.std.com>
Keywords: sort multiple keys

bosborne@nature.berkeley.edu (Brian Osborne) writes:

>I have strings, say, of this type :

>mmm12aaa aaa2xxx aaa1yyy mmm3xxx

>I can sort these to make  :

>aaa2xxx aaa1yyy mmm12aaa mmm3xxx

>but I cannot sort again on a second key to make :

>aaa1yyy aaa2xxx mmm3xxx mmm12aaa

What you want to do is to make one sort comparison function that will
sort on the primary key, and if that key is equal, sort on the
secondary key.




@input = qw(mmm12aaa aaa2xxx aaa1yyy mmm3xxx);

foreach (@input) {
  ($primary, @secondary) = /(\D+)(\d+)/; #divide input into keys
  push @primary, $primary;               #make a parallel array of
  push @secondary, @secondary;           #the keys.
}

# make an list containing indices that can access the original list or
# one of the lists of keys. Have the sort subroutine check each index
# and determine where its corresponding primary key fits in the sort sequence
# if the primary keys are equal, that the expression will be false. If so,
# use the corresponding secondary key for comparison. Once done, sort will
# have a list of indicies in the order in which the original input array
# needs to be sorted, use that list to extrace a slice of the original array
# in the proper order, and assign that slice as the final result.
@sorted = @input [ sort { $primary[$a] cmp $primary[$b] 
                         or $secondary[$a] <=> $secondary[$b] } 0 .. $#input];

foreach (@sorted) {
  print "$_\n";
}

For more information, check the article "Far More Than Everything You
Ever Wanted to Know About Sorting"
<http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html>
-- 
Andrew Langmead


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

Date: Sat, 01 Mar 1997 20:04:54 -0800
From: ook!@ook.org (ook!@ook.org)
Subject: Re: WANTED: BBEdit Tips and Tricks
Message-Id: <ook!-ya02408000R0103972004540001@snews.zippo.com>

Hi, I'm a book author and have no ideas, much less expertise in the subject
I'm covering, and I'd like you to fill in the content for me while I grab
the royalties and you get your name printed. I expect you to be naiive
enough to think that getting your name printed is a huge honor in and of
itself, as you'll be joining such luminaries as the people in today's
obituary column, people arrested for shoplifting nose hair clippers at
Wal-Mart, and the author of the famous treatise, "Women I'd Like to Pork".

-- 
Ook's a jerk. This is his evil twin telling you to ignore him while you
still can.


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

Date: 1 Mar 1997 23:59:57 -0800
From: cdaveb@best.com (Cari D. Burstein)
Subject: Re: WANTED: BBEdit Tips and Tricks
Message-Id: <5fbc1t$6eq@shellx.best.com>

In article <3317E8C6.2995@uswest.net>, Dana J. Dawson <dana@uswest.net> wrote:
>I would suggest you include a good section on regular expressions
>and how to use them, along with several examples.  They are extremely
>powerful - I use them constantly in a UNIX environment at work and
>am continuously finding new uses for them.

I'll second that- anyone using BBEdit that doesn't know regular expressions
is missing out big time.  I wrote a quick reference on them for all the
BBEdit users at work who aren't familiar with them.  Definitely supply
some useful find and replace functions for HTML editing (since that seems
to be the group that would most benefit from this book).  One that I've
come up with is a find and replace function to add quotes to all attributes
but I'm not sure if it's the best way to do it, so if anyone can suggest
a better way, please let me know.  BBEdit's grep function seems to be
very greedy, so I can't figure out how to quote more than one attribute
per tag short of running it multiple times till there aren't any more-
please tell me if there's a better way to do this:

Find: <([^>]*[A-Za-z]+)=([^" \t\n\r>]+)([^=>]*)>
Replace: <\1="\2"\3>

Other than that, pointing out that you can save extensions in the
HTML Tools custom section is a good idea- took me a while to find that.
Tips on disabling tags you don't use in ResEdit may not hurt (we only
use <STRONG>, never <B> at work, so I have disabled the <B> tag so
I'll never accidentally select it).  Definitely bring up useful extensions
that don't come with BBEdit- like Capitalizer, which I use a lot (better
than BBEdit's change case option) and make sure to explain the use of
templates and #includes.  It may be a good idea to cover using Frontier
and BBEdit together if you hadn't already considered that.  I don't normally
because I don't know Frontier well, but I'd love to have a reference that
deals with that.  Sound like a great book- I'll definitely buy it.

-Cari D. Burstein
cdaveb@best.com

-- 
|Ye have enemies?  Good, good- that means ye've stood up for         |
| something, sometime in thy life....  -Elminster of Shadowdale      |
|--------------------------------------------------------------------|
|Cari D. Burstein cdaveb@best.com http://server.berkeley.edu/~cdaveb |


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

Date: Sun, 02 Mar 1997 02:54:04 -0800
From: tim@dierks.org (Tim Dierks)
Subject: What's wrong with this Perl?
Message-Id: <tim-ya02408000R0203970254040001@nntp.best.com>

I'd like to know why this code doesn't work:

$#a = 5;
foreach $v (@a) {
    $v = 1;
}

Emits the error message:
Modification of a read-only value attempted at test.pl line 3.

I understand the error message and I even think I understand what's going
on. I also know how to work around this in every case I've run into it in.
However, I'd like some insight into why I can't modify a variable which is
aliased to an undefined value.

Thanks.

 - Tim

-- 
Tim Dierks      "Isn't sanity really just a one-trick pony anyway? I mean
Haruspex        all you get is one trick - rational thinking. But if you're
tim@dierks.org  good and crazy, ooh ooh ooh! The sky's the limit!" -The Tick


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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

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