[6949] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 574 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 5 09:12:15 1997

Date: Thu, 5 Jun 97 06:00:55 -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           Thu, 5 Jun 1997     Volume: 8 Number: 574

Today's topics:
     Re: *NOT SPAM* Apprentice Perl Hacker, Summer Work Offe (I R A Aggie)
     Re: Any non number but not a dot... (Terje Bless)
     Re: Atomic file create or fail if already existing <denkart@svabasydi1.flur.zuerich.ubs.ch>
     Consultant Wanted: To Port UNIX Perl to NT (Sara Young)
     Re: decimal to binary converter (Stephen Tell)
     delete lines directly from file (Pui Ming WONG)
     Re: delete lines directly from file (Martin Cohen)
     Re: How can I set up this server to run perl faster?... <perlprogrammer@hotmail.com>
     Re: How can I set up this server to run perl faster?... (Richard Irwin)
     Re: How can I set up this server to run perl faster?... <mess@iht-ii.rwth-aachen.de>
     Re: how do I delete all the $s from a string(probably s <dada@divinf.it>
     How to do 'chmod' <O.C.Kwon@durham.ac.uk>
     How to send email with Mime attachment? <sbekman@iil.intel.com>
     Re: New draft of scripting white paper <cimarron@dis.org>
     New Module List Posted (Andreas Koenig)
     Re: newbie question (Tad McClellan)
     Re: PGPERL (Georg Fuellen)
     Re: replacing spaces with underscores <dada@divinf.it>
     Search Engine <X.Coulon@herts.ac.uk>
     Re: String Compare Problem <dada@divinf.it>
     Re: Suggestion to all frequent posters/answerers (Tung-chiang Yang)
     Re: Telnet (I R A Aggie)
     Re: What does "UNIX" stand for.. <bill.erwin@gsa.gov>
     Re: why won't 'print <<end_print...end_print' work? <jbokma@caiw.nl>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 04 Jun 1997 09:35:58 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: *NOT SPAM* Apprentice Perl Hacker, Summer Work Offered
Message-Id: <fl_aggie-ya02408000R0406970935580001@news.fsu.edu>

In article <5n2qq9$jqp$1@news.isc.rit.edu>, bcmdco@osfmail.isc.rit.edu (B.
Mathis) wrote:

+ You, sir or madam, are a moron.

I see, you've read _How to Win Friends and Influence People_.

+ First, if we start by defining "spam" in internet terms,

Is there any other kind?

+ we find a definition of "mass distribution of a
+ message that is unrelated to the groups they are posted in".  This
+ message is quite clearly about a perl related topic, that was posted
+ in a group about perl.

But was off-topic and inappropriate. Unless this group got renamed while
I wasn't looking and is now comp.lang.perl.misc.jobs.offered? According
to your definition, many of this groups denizens are doing a Bad Thing
by redirecting CGI questions to the CGI newsgroup...

Job offering properly belong in *.jobs.*,  not in a _discussion_ group
about a particular language.

Followups...

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Thu, 05 Jun 1997 14:06:56 +0200
From: link@tss.no (Terje Bless)
Subject: Re: Any non number but not a dot...
Message-Id: <link-YANW250b4-0506971406560001@news.uit.no>

In article <92clm5.g7e.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:

>"inside square brackets" is more properly called a "character class".
>
>There are _very_ few special chars in a character class:
>
>\         escape char
>
>]         ends the char class

Unless, of course, it's the first character in the class. []:-]

-- 
Party? Party, lord? Yes, lord. Right away, lord.
        - Beopunk Cyberwulf


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

Date: Thu, 05 Jun 1997 09:47:19 +0200
From: Davy Van Elst <denkart@svabasydi1.flur.zuerich.ubs.ch>
Subject: Re: Atomic file create or fail if already existing
Message-Id: <33966F07.14F4@svabasydi1.flur.zuerich.ubs.ch>

Consider using semaphores, they are specially created for these things.
I don't know the exact syntax (look at man semop and perlfunc) because
I've never worked with them before, but I know for sure that the
setting of a semaphore is atomical and once it is set, the other one
will have to wait until the semaphore is unset. I hope this helps.

Regards,

Davy.


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

Date: Thu, 5 Jun 1997 08:58:14 GMT
From: syoung@actcom.co.il (Sara Young)
Subject: Consultant Wanted: To Port UNIX Perl to NT
Message-Id: <EBAox3.332@actcom.co.il>

My client would like to port a number of Perl scripts to NT.

Since I don't have any NT experience, we would like to hire
somebody to help me out when I get stuck.  This person will also
offer general advice.

All the work will be done off-site.

Please send your qualifications and compensation requirements to
syoung@actcom.co.il.

Sara Young


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

Date: 3 Jun 1997 22:33:09 -0400
From: tell@cs.unc.edu (Stephen Tell)
Subject: Re: decimal to binary converter
Message-Id: <5n2k55$1ru@rukbat.cs.unc.edu>

In article <5mni6b$8tu@acmex.gatech.edu>,
Mike East <gt6242b@prism.gatech.edu> wrote:
>Does anyone know how to convert decimal numbers to binary numbers in
>Perl???

It's not quite clear what you mean by "decimal" and "binary" ...  Someone
else posted an integer to BCD-as-ascii function.

Here's a function I've used to print integers in binary form
for human consumption.  It always puts the least significant bit
on the right end of the string, no matter what the endianness of your host is.
It assumes that the native integer size of your system is 32 bits.
Getting this right took some fiddling around. 

#
# string pbinr(int number_of_bits, int value_to_convert)
#
# given an integer,
# returns string of ascii 1's and 0's for legible binary printing.
# always returns exactly the number of bits asked for.
# 
sub pbinr($$)
{
	my($bits, $val) = @_;
	my($v, $bstr);
	$v = pack("N", $val);
	$bstr = unpack("B32", $v);
	return substr($bstr, -$bits);
}





>Thanks
>Mike
>-- 
>----------------------------------------------------------------------------- 
>   Mike East                       |       Georgia Institute of Technology
>   gt6242b@acme.gatech.edu         |       Computer Engineering

-- 
Steve Tell       tell@cs.unc.edu	W: +1 919 962 1845
Research Associate, Microelectronic Systems Laboratory
Computer Science Department, UNC@Chapel Hill.   


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

Date: 5 Jun 1997 09:19:36 GMT
From: s11976@net2.hkbu.edu.hk (Pui Ming WONG)
Subject: delete lines directly from file
Message-Id: <5n60b8$b14$1@power42t.hkbu.edu.hk>

I would like to know if the way to delete a line from an
OPENed file.

I know a easy way is to read each line from the OPENED file,
then write each line (except the line to be deleted) to a second file,
and finally rename it to be the same name as the OPENED file.
But i don't want to do that.
It'll be handy if i could simply delete the line straight from
the OPENED file (just like an editor can).
Possible ?
--
        __
   / \_/  )             __   Pui Ming WONG (E-mail: pm@hkbu.edu.hk) 
  /      ( -------------  }  System Support Programmer
 (  =l=ll===============__}  Computing & Telecomm. Services Centre
  \   _  (                   Hong Kong Baptist University 
   \_/ \__)                  224 Warerloo Road, Hong Kong 


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

Date: 5 Jun 97 07:10:25 GMT
From: mcohen@arl.mil (Martin Cohen)
Subject: Re: delete lines directly from file
Message-Id: <33966661.4320@arl.mil>

Pui Ming WONG wrote:
- 
- I would like to know if the way to delete a line from an
- OPENed file.
- 
- I know a easy way is to read each line from the OPENED file,
- then write each line (except the line to be deleted) to a second file,
- and finally rename it to be the same name as the OPENED file.
- But i don't want to do that.
- It'll be handy if i could simply delete the line straight from
- the OPENED file (just like an editor can).  <------------------
- Possible ?
- --
-         __
-    / \_/  )             __   Pui Ming WONG (E-mail: pm@hkbu.edu.hk)
-   /      ( -------------  }  System Support Programmer
-  (  =l=ll===============__}  Computing & Telecomm. Services Centre
-   \   _  (                   Hong Kong Baptist University
-    \_/ \__)                  224 Warerloo Road, Hong Kong

I think the typical text editor uses the method you outlined, ie.,
it makes a new copy of the file and renames it.

If you really have to do what you say, one algorithm is:

	find the line
	copy the rest of the file overlaying the line and the rest of the file
	truncate the file at its new end (not portable)

An approach that may work depending on the application of the file:

	find the line
	change it to null characters (including the eol)

The programs that use the file would have to ignore the nulls.
-- 
Martin Cohen - AMSAA-North - Custom House Rm 800 Phila PA 19106-2976


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

Date: Wed, 04 Jun 1997 23:56:41 -0700
From: perl guy <perlprogrammer@hotmail.com>
Subject: Re: How can I set up this server to run perl faster?...
Message-Id: <33966329.5147@hotmail.com>

Luuk de Boer wrote:
> 
> >That's not really the problem though.. I assume that the time out,
> >keepalive, keepalive timeout, etc. time needs to be set differently..
> >I'm not sure what these need to be set to really.. as I did the perl..
> >but my server admin seems to need advice on how to configure the server
> >better, and I am clueless.. This is why it's partly being posted in the
> >unix/linux. As well as for the server configs that may help or IDEAS
> >that may help me with how to run less instances, etc of the perl.exe?. I
> 
> To make apache 1.1.1 or newer versions faster you have to set the
> following things ... (my own experience).
> <httpd.conf>
> HostnameLookups off (faster response)
> Timeout 1200
> KeepAlive On (this keeps the amount of connections down)
> KeepAlive 100 (same as above)
> MaxKeepAliveRequests 100 (1.2beta version - apache)
> KeepAliveTimeout 30 (we want as much as keepalive as we can)
> MinSpareServers 10
> MaxSpareServers 20
> StartServers 10
> MaxClients 220 (When you have a lot of people at one moment at your
> site this has to go up because of the amount of connections you will
> get) -> for apache 1.1.1 I believe you have to edit this in the source
> also and compile it again but I am not sure about that.
> 
> This was for me enough to get my linux machine keeping the http server
> alive.
> 
> Greetz....
> 
> Luuk


Thank you.. it's some of the little things about config that I've been
looking into with no luck, as well as other little things. Between
things like this, advice thanks to people such as yourself and others
that have posted, it will be very helpful.. Thank you again>> :)


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

Date: Thu, 05 Jun 1997 07:58:23 GMT
From: ricky@reelradio.com (Richard Irwin)
Subject: Re: How can I set up this server to run perl faster?...
Message-Id: <3396711a.128459346@news.sna.com>

On Sun, 01 Jun 1997 23:22:22 -0700, perl guy
<perlprogrammer@hotmaill.com> wrote:

>I am running a chat site that is getting a huge amount of traffic, and I
<snip>
>Here's what the mess looks like..
>
>USER       PID %CPU %MEM  SIZE   RSS TTY STAT START   TIME COMMAND
>nobody   29774  0.3  1.5  1232   720  ?  S   22:11   0:02 httpd 
>nobody   29936  0.2  1.5  1228   728  ?  S   22:14   0:01 httpd 
>nobody   29985  0.3  1.5  1232   728  ?  S   22:15   0:02 httpd 
<snip>

First thing I would do is turn off server logging.  You know you have
a problem - why place more load on the system by logging it all?



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

Date: Thu, 05 Jun 1997 12:12:26 +0000
From: Michael Mess <mess@iht-ii.rwth-aachen.de>
To: perlprogrammer@hotmaill.com
Subject: Re: How can I set up this server to run perl faster?...
Message-Id: <3396AD2A.377B4F03@iht-ii.rwth-aachen.de>

Hi,

perl guy wrote:
> 
> Huge aplogies for the major cross-postings.. but I have NO idea where to
> post to, other then the fact that it has to do wth all the formentioned
> subjects.
> 
> Ok, first off, I am running perl 5.003 on a Linux Kernel 2.0.18 on an
> i486 server with Red Hat 4, Apache 1.1.1, 5 disk partiions of 300 Megs
> each, 48 MEGS RAM with a 60 MEG swap file..
> 
> I am running a chat site that is getting a huge amount of traffic, and I
> need to find out a way, to only run one continous instance of perl, or
> something that won't chew up the drive or slow things down so terribly!
> It's literally killing the hard drive from all the people. I need to
> find out a way to configure something too possibly for the best way to
> run the server for this sort of thing. I wish it was on the NT bo,
> because I could do an ISAPI type thing.. but what can I do on a Linux
> with Perl?. I seriously have no idea. every time someone transfers the
> data, it's calling to the perl.exe, and wth all the people at once, it's
> too much! I read the error logs, and I see a lot of these errors for
> example:
> "send script output lost connection to client -blah-", *mostly these*
> "request lost connection to client -blah-", *a lot of these*
> "access to /my_dir/chat.pl failed for -blah-, reason: POST or PUT
> without Content-length:" *a few of these*
> 
> That's not really the problem though.. I assume that the time out,
> keepalive, keepalive timeout, etc. time needs to be set differently..
> I'm not sure what these need to be set to really.. as I did the perl..
> but my server admin seems to need advice on how to configure the server
> better, and I am clueless.. This is why it's partly being posted in the
> unix/linux. As well as for the server configs that may help or IDEAS
> that may help me with how to run less instances, etc of the perl.exe?. I
> am so lost.. the script works great, untill I get over 50 or 60 people
> in the rooms.. then it gets very slow and has problems.. it starts to
> crash my server, and I have to telnet in and restart the websever 3
> times a day!.. it's getting out of control, and I don't have weeks or
> months ro read up on this.. unfortunately, it's too late to take the
> site down until *I* find out how to configure the script, and the
> server, etc.. I am also posting this to the perl news groups, as wel as
> cgi because I'm sure that someone there will have some experiance of how
> to run things more smoothly in the script configuartion.. something I
> may have missed.. sorry this is so vague.. but this is all my problem
> seems to be, and I don't have a clue of what to do now!.  I hope someone
> can help.. for an idea of what's going on (at a slow time of the day), I
> go to telnet and type in "ps -aux" and I get this.. you can see how it's
> killing my drive..
> BTW, the pipe is not being hogged up at all.. it's taking barely any...
> 
 ...
> How can I stop this, por fi the problem?. Anyone.. please help.. I beg
> of you.. any suggestions, or any pointers to a site that specifically
> talks about this.. I have endlessly searched dejanews, and all the other
> arhives, been to all the sites for Apache, Linux, Unix, Perl, CGI,
> etc..etc.. and no one has any info on this delima..
>                 Thank you very much for the time you took to even read this.. :)
> 
>                   #stressed$%....
I suggest you to buy a harddisk and use this harddisk only for swapping.
When you have swap on a separate drive or a drive which is not accessed
often, this will increase the systems' speed.

If this doesn't solve your problem, buy more RAM.
You should have at least 64 MB Ram.

Michael











































 .


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

Date: Thu, 05 Jun 1997 10:23:51 +0200
From: Aldo Calpini <dada@divinf.it>
To: bhall@mail.tds.net
Subject: Re: how do I delete all the $s from a string(probably simple)
Message-Id: <33967797.479B8F8E@divinf.it>

The Halls wrote:
> 
> Hi,
> 
> For a simple perl script I'm writing, I need to delete all the $
> characters in a variable. Say if my code is:
> 
> my $extra_price_1 = '$123.89';
> 
> I need the result to be 123.89. I thought it would be something like:
> 
> $extra_price_1 =~ s/$/d/;

It is really simple indeed:

$extra_price_l =~ s/\$//g;

The \ before $ tells Perl it is a literal dollarsign, not the end of the
line (in a regexp) or a variable name (if followed by one or more
alphanumericals). The same applies for other Perl's special chars (eg.
\@, \%, \^, and so on).

Oh, and the final g tells Perl to substitute all the $'s in the string,
otherwise only the first found would be deleted.

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: 5 Jun 1997 10:17:32 GMT
From: O C Kwon <O.C.Kwon@durham.ac.uk>
Subject: How to do 'chmod'
Message-Id: <5n63ns$3sp@mercury.dur.ac.uk>
Keywords: chmod

Hello ALL,

I failed to do 'chmod' the permissions of a file.
Does anyone let me know why the following script does not 
work?
Thanks in advance.

-------
#!/usr/local/bin/perl 

open(SESAME, "/home/user1/summary/sum_S0001.txt") || die
"Cannot open sum_S0001.txt: $!\n";
chmod(0666, "/home/user1/summary/sum_S0001.txt");  
close(SESAME);
-------





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

Date: Thu, 05 Jun 1997 10:58:58 +0300
From: Bekman Stanislav <sbekman@iil.intel.com>
Subject: How to send email with Mime attachment?
Message-Id: <339671C2.167E@iil.intel.com>

Hi,
I need to send email with hebrew text the letters are need the 8th bit 
which is stripped on the way. So I thought to send it with Mime
attachment, but I see that mime.pm is an empty package ???

Ofcourse the email is being sent from the perl script

Any ideas or other solutions?
Thanks a lot!


Stas Bekman 
-------------------------------------------------------------------
Resource Center http://www.mardanit.co.il/Center (CGI, PC, Security,
Linux)
Linux-il Home:	http://www.linux.org.il/


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

Date: Thu, 05 Jun 1997 00:45:19 -0700
From: Cimarron Taylor <cimarron@dis.org>
Subject: Re: New draft of scripting white paper
Message-Id: <33966E8F.C8A@dis.org>

Donal K. Fellows wrote: 
> In article <3383ADEA.58FA@dis.org>, Cimarron Taylor  <cimarron@dis.org> wrote:
> > However, creating new procedures and alternate ways of expressing
> > flow control are all well and good but to say these techniques
> > allow you to extend the "programming paradigm" is too much of a
> > stretch for me.
> 
> Tcl is more powerful than the shells since I know I can extend Tcl
> (without additional C) to have object-oriented semantics (admittedly,
> the syntax is not as good as you might wish) and I can also do things
> that are remarkably close to lazy programming.  I don't know what you
> think, but they look like different paradigms to me.

	In the particular case you mention (object-oriented semantics)
	is interesting because the technique predates Tcl and in fact
	has been used in various shell programs.  I've seen shell scripts
	which read a lot like "oo" Tcl programs (e.g. $object do something..)
	I think oo syntax tricks didn't ever catch on in /bin/sh or other 
	shells because the time wasn't right.  I'm not certain what you
	mean exactly by "lazy programming" so perhaps you could elaborate
	more on this.  Does Tcl turn people into lazy programmers? :-)

> Note that I don't claim that Tcl does these as well as some other
> languages, but merely that it is possible to use techniques from those
> styles of programming without great amounts of pain, unlike other
> languages I can think of.  Particularly helpful is the ability to
> create new pieces of syntax to dress up new semantics - a great way of
> making a piece of code easier to maintain since you can cut out the
> bits which do not pertain to the overall conceptual semantics.

	In this I agree entirely.  Tcl allows you to use many
	different programming techniques.  However to me that's 
	not the same as "extending the paradigm".  Extending the
	paradigm to me means something far more radical, like
	using declarative statements instead of procedural ones
	or visual elements instead of textual ones or combining
	programming and specification into a single process or
	something other than just fiddling with a reinvention
	of the lisp macro facility.

> By not attaching complex semantics to everything in sight itself and
> not placing a complex syntax over the top of it all, Tcl makes it much
> easier to add application-specific syntax and semantics to scripts.

	Don't other languages do this as well?  Sounds like the same
	argument can be made for lisp, /bin/sh and just about anything
	that keeps its fundamental expression evaluation mechanism
	simple.

> My experience is that it is the app-specific stuff that tends to cause
> Tcl scripting to win out (Tk is an example of app-specific syntax and
> semantics being added to Tcl, and the difficulty that many other
> authors have had with combining Tk with other languages has served to
> indicate just how good Tcl is at embedding external syntax and
> semantics).  

	But Tk has been integrated with perl, scheme, and /bin/ksh.
	To me this example shows that Tk is well engineered, not 
	that Tcl is fundamentally better than the other tools.


> The fact that the core commands in the Tcl library are fairly well rounded 
> for general use is a bonus, but these are not what makes Tcl.

	In a purely theoretical sence you are right, but in 
	practice I think very few would use Tcl if the library 
	wern't well engineered.  From 1988 to 1992, Tcl was 
	perhaps the best piece of unix software in existance.

	Cim


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

Date: 5 Jun 1997 11:31:08 GMT
From: andreas.koenig@franz.ww.tu-berlin.de (Andreas Koenig)
Subject: New Module List Posted
Message-Id: <5n681s$k68$1@brachio.zrz.TU-Berlin.DE>
Keywords: FAQ, Perl, Module, Software, Reuse, Development, Free


The Perl 5 Module List, v2.42...
================================

A new revision is on it's way around USENET and CPAN. It has been
posted to

    news:comp.lang.perl.modules

and uploaded to

    http://www.perl.com/CPAN/modules/00modlist.long.html

The recent changes are appended below. As usual, comments, corrections
and suggestions are more than welcome. Please don't hesitate, mail
them to modules@perl.org

I believe that I have taken into account all mails we have received
since the last posting. If this is not the case, please let us know.

A big Thank You to all contributors helping us to keep the document up
to date, and very special warm regards to those having their birthdays
these days :-)

andreas


Recent Changes in the modules database
--------------------------------------

4) Operating System Interfaces
 ------------------------------
PDA::
::Pilot        amcO  Interface to pilot-link library              KJALB +

Proc::
::ExitStatus   cdpf  Interpret and act on wait() status values    ROSCH +
::SafePipe     cdpf  popen() and `` without calling the shell     ROSCH +
::SyncExec     cdpf  Spawn processes but report exec() errors     ROSCH +


5) Networking, Device Control (modems) and InterProcess Communication
---------------------------------------------------------------------
DCE::
::DFS          bdcO  DCE Distributed File System interface        PHENSON +

IPC::
::Signal       cdpf  Translate signal names to/from numbers       ROSCH +

Net::
::SNMP         adpO  Interface to SNMP Protocol (RFC1157)         GBARR +


6) Data Types and Data Type Utilities (see also Database Interfaces)
--------------------------------------------------------------------
Bit::
::Vector       RdcO  Efficient bit vector and set base class      STBEY !

Object::
::Store        ad+O  ObjectStore DBMS Interface                   JPRIT +

Statistics::
::Descriptive  RdpO  Descriptive statistical methods              COLINK !


10) File Names, File Systems and File Locking (see also File Handles)
---------------------------------------------------------------------
File::
::lockf        bdcf  Interface to lockf system call               PHENSON +


11) Text Processing, Parsing and Searching
------------------------------------------
String::
::ShellQuote   adpf  Quote string for safe passage through shells ROSCH +


13) Internationalization and Locale
-----------------------------------
Locale::
::Country      Rdpf  ISO 3166 two letter country codes            NEILB !
::Language     Rdpf  ISO 639 two letter language codes            NEILB !


19) Mail and Usenet News
------------------------
News::
::Gateway      cdpO  Mail-to-news gateway and robomoderator       RRA +


Recent Changes in the users database
------------------------------------
+  ABURLISON Alan Burlison <Alan.Burlison@UK.Sun.COM>
+  COLINK   Colin Kuskie <colink@latticesemi.com>
+  CTDEAN   Chris Dean <ctdean@aig.jpl.nasa.gov>
+  DSTALDER Darren Stalder <torin@daft.com>
+  HMUELLER Hanno Mueller <hmueller@mail.kabel.de>
+  JHORWITZ Jeff Horwitz <jhorwitz@umich.edu>
+  JKODIS   John Kodis <kodis@jagunet.com>
+  JPRIT    Joshua Pritikin <pritikin@interramp.com>
+  KENFOX   Ken Fox <fox@vulpes.com>
+  MJAEG    Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
+  PHENSON  Paul B. Henson <henson@acm.org>
!  RRA      Russ Allbery <rra@stanford.edu>
!  SDOWD    Sean Dowd <dowd@flash.net>


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

Date: Thu, 5 Jun 1997 07:10:11 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: newbie question
Message-Id: <3ba6n5.0m.ln@localhost>

Tung-chiang Yang (tcyang@netcom.com) wrote:
: I am a newbie ......  but why will every line after the first be indented
: by one space?  

Because the @mylist is in a double quoted string in the print statement.

from the perlvar man page:

----------------------------------
=item $LIST_SEPARATOR

=item $"

This is like "C<$,>" except that it applies to array values interpolated
into a double-quoted string (or similar interpreted string).  Default
is a space.  (Mnemonic: obvious, I think.)
----------------------------------


[snip]

: : > print "@mylist";

: : No. The main problems with that code are
: :   1. it never checks that the file was successfully opened,
: :   2. it needlessly loads the entire file into memory (in @mylist), and
: :   3. it will indent every line after the first by one space.


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


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

Date: Thu, 5 Jun 1997 09:45:26 GMT
From: fuellen_NO_SPAM_PLEASE_@techfak.uni-bielefeld.de (Georg Fuellen)
To: Sean Gillen <Sean_Gillen@sbphrd.com>
Subject: Re: PGPERL
Message-Id: <EBAr3r.1xw@hermes.hrz.uni-bielefeld.de>

In article <33944DC2.7165@sbphrd.com>, you write:
|> I am currently performing graphics with perl using pgperl. I have a
|> problem though printing letters as the values on my x-axis. On my graph
|> at the moment I am displaying month numbers along the x-axis in the
|> following way:
|> 
|> 1 2 3 4 5 6 7 8 9 10 11 12
|>          Month
|> 
|> I would rather have it in the following format:
|> 
|> Jan  Feb  Mar  Apr  May Jun  Jul  Aug  Sep  Oct  Nov  Dec
|>                          Months
|> 
|> 
|> The only snag is that i'm using the PGENV function and it requires a
|> real  value for the x-axis, therefore not allowing letters on the axis.
|> Is there a way around this? Please let me know.

Here's my workaround...
At http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/Docs/Media/aln1.gif
the following code is used to print the x-axis labels 
``1 0.59'' ``2 0.53'' etc (below the yellow letter plot).
The x-axis labels are stored in $col_labels, and there are $jj_size
of them altogether.

  my ($x1,$x2,$y1,$y2,$x1_factor,$x2_factor,$y1_factor,$y2_factor);
  pgqvp(0,$x1_factor,$x2_factor,$y1_factor,$y2_factor);
  pgqwin($x1,$x2,$y1,$y2);
  my $x_bottomleft=$x1_factor*($x2-$x1);
  my $y_bottomleft=$y1_factor*($y2-$y1);

  my($ii,$jj,$kk);
  my ($xcoord,$ycoord);
  for ($jj=0; $jj<$jj_size; $jj++) {
    $xcoord=0.75+($jj);
    pgptxt($xcoord,-1.5*$y_bottomleft,90,0,$col_labels->[$jj]);
  }

Probably you need to readjust the hard-wired values ``0.75'' and ``-1.5''...
Maybe Karl (who I copied in) has a better solution - please let me know !

best wishes,
Georg Fuellen
Univ. Bielefeld, Research Group in Practical Comp. Science, Fax +49 521 106 6411

|> Thanks Sean.


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

Date: Thu, 05 Jun 1997 10:27:34 +0200
From: Aldo Calpini <dada@divinf.it>
To: Matt Ferrell <mferrell@planeteers.com>
Subject: Re: replacing spaces with underscores
Message-Id: <33967876.EE8C6977@divinf.it>

Matt Ferrell wrote:
> 
> Howdy, sorry about the simplicity of this question but I have a simple
> perl script that I need to hack some to simply replace the spaces in 
> one of my variables with underscores

$subject =~ tr/ /_/;

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: Thu, 05 Jun 1997 12:49:17 +0100
From: Coulon <X.Coulon@herts.ac.uk>
Subject: Search Engine
Message-Id: <3396A7BD.3080@herts.ac.uk>

Hello,

I'm very new at PERL, and I use the compiler for Win32.
I would like to write a script that opens a file, looks for a word and
prints the found line. Basically, the file would be an index file, and I
should then add some HTML tags to link to the destination.

Do you have any idea of how I could start ?
Which functions should I use ?
Thanks a lot.
Xavier Coulon.


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

Date: Thu, 05 Jun 1997 10:17:38 +0200
From: Aldo Calpini <dada@divinf.it>
To: Paul Cartier <pcartier@ix.netcom.com>
Subject: Re: String Compare Problem
Message-Id: <33967622.31CE7ED8@divinf.it>

Paul Cartier wrote:
> 
> Could someone give me an example on how I can search the
> begining of a string for a match.
> 
> for example, when searching for a zip-code (065) using
> the code below will return
> 
> 06518 this is the result I am looking for, all 065???? values
> 87065 Not the two below.
> 80653

if ($db_value =~ /^$match_word/) {

The ^ does the trick. It stands for 'the beginning of the line'.

Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/  \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\  /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------


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

Date: Thu, 5 Jun 1997 07:04:32 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Suggestion to all frequent posters/answerers
Message-Id: <tcyangEBAJnK.FoE@netcom.com>

This is not necessarily a good idea.  Once I (as a newbie) post a question
with a subject "XXXXXXX", I look for followups along that subject, no
matter how ridiculous it is.  If you add RTFM/RTF/CPAN, probably I would
not read it.

This applies to all newsgroups.  There are only two solutions for this:

(1) moderate CLPM.
(2) those who might post RTFM/RTF/CPAN set up an account jointly, whose
    existence is for posting RTFM/RTF/CPAN only, then old-timers can killfile
    posts from this account.

In fact, it does not need to be a real account.  A simple fake address
like

>From: clpm_answerer@clpm.com (FAQ Answerman)

is good enough.  But most people in this group does not enjoy fake addresses.

=================================
Jahwan Kim (jahwan@supernova.math.lsa.umich.edu) wrote:
: Dear all perl-lover/clpm-regulars,

:     I've been following this group quite closely for about 2-3 months.
: As is expected from such a heavy traffic news group, I've seen/posted flames,
: clueless/ad hoc questions being asked and answered.  All in all, this helped
: me understand/love Perl better.
:     One thing I noticed is, there're quite a lot of postings which contain
: only RTFM/RTF/check CPAN.  While these postings will help and guide the
: original poster, they do not interest regular READERS like myself so much.
:     So I suggest/ask you with all my respect to include RTFM/RTF/CCPAN in
: the subject line, when your posting does not have anything else at all.
: I surmise that this suggestion, if taken by most of clpm answer guys(*),
: will reduce the time I spend reading clpm by 10-20%.  I hope many of you out
: there agree with me.

: Jahwan

: (*) Isn't it so sad that clpm now *appears* to be a question/answer bulletin
: board rather than a discussion group?  (But remember you'll always find Perl
: in mud.)

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Wed, 04 Jun 1997 22:04:30 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Telnet
Message-Id: <fl_aggie-ya02408000R0406972204300001@news.fsu.edu>

In article <5n4k99$4e8@fridge-nf0.shore.net>, nvp@shore.net (Nathan V.
Patwardhan) wrote:

+ CAD-VISIOGRAPH (visiocad@easynet.fr) wrote:
+ : can I execute a Telnet with PERL and giving automaticaly the username and
+ : the password ?
+ 
+ Use the Net::Telnet module, distributed as part of the libnet module.

No, actually not. It's been unbundled from the libnet package, and
should be easily findable in the CPAN archive.

BTW, it comes with a perldoc manual of 19 pages. I only skimmed,
but it seemed to offer quite a few examples.

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: 5 Jun 1997 11:41:41 GMT
From: "Bill Erwin" <bill.erwin@gsa.gov>
Subject: Re: What does "UNIX" stand for..
Message-Id: <01bc71a4$dca66980$49818e9f@gsa.gov>

UNIX started out as "Castrated MULTICS" and was shortened from there. 
Check out the "UNIX Haters Handbook" for further details.

Bill




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

Date: 5 Jun 1997 09:04:01 GMT
From: "John Bokma" <jbokma@caiw.nl>
Subject: Re: why won't 'print <<end_print...end_print' work?
Message-Id: <01bc718f$9c0708e0$d40ab2c2@tschai>



perl guy <perlprogrammer@hotmaill.com> wrote in article
<339518F2.291A@hotmaill.com>...
> John Bokma wrote:

> > I think the editor somehow put a space behind the terminator of
some
> > other hidden thingy.

> John.. if you see this.. I'm curious to know what editor you used
that
> may have done this.  I've found that certian online editors will
word
> wrap (way too soon), or just do something weird.. Just curous to
know..
> Thanks...
> 

Wordpad. But maybe it did it on purpose, because I hit the space bar
without
knowing 8-)...

John


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

Need a Freelance Software Developer (MSc)? (CGI, Perl, Java, C, C++)

http://www.caiw.nl/~jbokma [Java demo's, Curriculum Vitae and
more...]

email: jbokma@caiw.nl  phone: +31 10 4291827



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

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

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