[12834] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 244 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 24 15:07:18 1999

Date: Sat, 24 Jul 1999 12:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 24 Jul 1999     Volume: 9 Number: 244

Today's topics:
        directory sizes (Brian Pontz)
    Re: Finding duplicate elements in an array? (Larry Rosler)
    Re: Finding duplicate elements in an array? <Joe.Kline@sdrc.com>
    Re: Geekspeak Programming Contest <tchrist@mox.perl.com>
    Re: Geekspeak Programming Contest <tchrist@mox.perl.com>
    Re: Module for e-mail <NOSPAMebin111@yahoo.com>
    Re: output of print map ( { unless (/^#/) {} } ("#") ); (Michael Wang)
    Re: output of print map ( { unless (/^#/) {} } ("#") ); (Michael Wang)
    Re: output of print map ( { unless (/^#/) {} } ("#") ); (Michael Wang)
        Pattern Matching (RPJOSE82)
    Re: Pattern Matching <NOSPAMebin111@yahoo.com>
    Re: Pattern Matching <aperrin@mcmahon.qal.berkeley.edu>
    Re: Pattern Matching (Larry Rosler)
    Re: Perl 4 Source Code or Binaries (Abigail)
    Re: perl and java <gellyfish@gellyfish.com>
    Re: Perl CGI vs VB ASP <gellyfish@gellyfish.com>
    Re: perl-DBI-mysql <lehmann@cnm.de>
    Re: perl-DBI-mysql <klaus.oberecker@gmx.at>
        program runtime problem.. <mfcho7@ie.cuhk.edu.hk>
        Reading Data from a file to a variable? <Scot@Cyber-Shopper.com>
        regexp help satishc@my-deja.com
        regexp help satishc@my-deja.com
    Re: split([tabulator],$line ); <andy@focus-consulting.co.uk>
    Re: split([tabulator],$line ); <NOSPAMebin111@yahoo.com>
    Re: split([tabulator],$line ); <NOSPAMebin111@yahoo.com>
    Re: Telnet via CGI? <gellyfish@gellyfish.com>
        Variables in Regx? (Argouarch)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sat, 24 Jul 1999 19:08:28 GMT
From: pontz@channel1.com (Brian Pontz)
Subject: directory sizes
Message-Id: <379a0aad.10547406@news2.channel1.com>

Hello,
Does anyone know how to get a total directory size including all the
subdirectories? I thought about using
 system("du -c /path/to/directory/");
But I cant get this to work correctly

#!/usr/local/bin/perl -w
$max=10000;

opendir(HOME, "/path/to/dir") || die "Couldnt open dir:$!";
@array=readdir(HOME);
closedir(HOME);
  foreach (@array) {
    next if -f;
    $name=$_;
    system("du -c /usr/home/$name/www/ | grep total | cut -f1 -dt")
    $total=<STDOUT>;
      if($total > $max) {
        print $name;
      }
  }
This still prints out everything. I tried making the ">" into "<" but
that didnt help.

Brian Pontz 


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

Date: Sat, 24 Jul 1999 10:38:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Finding duplicate elements in an array?
Message-Id: <MPG.120399d7155daefe989d35@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <19990724125626.22482.00001462@ng-cg1.aol.com> on 24 Jul 1999 
16:56:26 GMT, Pfash1 <pfash1@aol.com> says...
> I have been struggling with a Perl issue that you might have some insight on:
> How do I check an array of undetermined size to see if there are duplicate
> elements contained in it? In other words:
> 
> @arrayone = ('one', 'two', three', 'one')
> 
> Let's say this array is initiated by a database search so I don't know the
> number of elements in the array or their location.
> I want to march thru this array and compare each element to every other one to
> find out if there are any duplicates (as is the case with element "one" in the
> example above).
> 
> Do you have an idea about this? I have sweated over this one and can't find
> anything in my books that  works.
> (ps. I eventually want to eliminate the duplicates so there is only one of
> each.)

RTFFAQ.

perlfaq4: "How can I extract just the unique elements of an array?"

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 24 Jul 1999 13:40:24 -0400
From: Joe Kline <Joe.Kline@sdrc.com>
To: Pfash1 <pfash1@aol.com>
Subject: Re: Finding duplicate elements in an array?
Message-Id: <3799FA88.6667EA01@sdrc.com>

[reply cc'd to requester and posted as well]

Pfash1 wrote:
> 
> I have been struggling with a Perl issue that you might have some insight on:
> How do I check an array of undetermined size to see if there are duplicate
> elements contained in it? In other words:
> 
> @arrayone = ('one', 'two', three', 'one')
<SNIP>
>Do you have an idea about this? I have sweated over this one and can't >find
>anything in my books that  works.

First off, get _The Perl Cookbook_ it has this in it.

Second off, here is the untested solution (I hope this isn't for an
assignment, dude):

my %elements
foreach (@arrayone)
{
    $elements{$_}++;
}

I'll leave it as an exercise for the reader to determine which elements
are unique and which are duplicates. (Hint: print out key-value pairs
for the hash)

joe 

--


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

Date: 24 Jul 1999 12:51:41 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Geekspeak Programming Contest
Message-Id: <379a0b3d@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, kingjw@sp2n23-t.missouri.edu () writes:
:> * millennium = millenium
:
:[which reminds me of an article I once saw in the San Diego Union
: where they described the year that Charles and Diana divorced as
: Queen Elizabeth's "anus horribilis"]

Are you calling the Queen a bad-ass? :-)

It's scary how many people confuse a thousand arses with a thousand
years.  Even the papers do it.

--tom
-- 
lint(1) is the compiler's only means of dampening the programmer's ego.


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

Date: 24 Jul 1999 12:56:56 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Geekspeak Programming Contest
Message-Id: <379a0c78@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:
:>  * Microsoft's mistakes = virii
:Tsk tsk...  I know you know better than that, Tom.  ;)

Users say "Microsoft design flaws".  Lusers say "virii".

    one of them   = virus
    two of them   = virii
    three of them = viriii
    four of them  = viriv
    five of them  = virv 
    six of them   = virvi

etc.

--tom
-- 
"I believe OS/2 is destined to be the most important operating
system, and possibly program, of all time" - Bill Gates, Nov, 1987.


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

Date: Sat, 24 Jul 1999 10:28:24 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: Module for e-mail
Message-Id: <ANmm3.94$Iy.6845@typhoon-sf.snfc21.pbi.net>

Thank you all for your help.  I will look into these two sources to see what
I can find.

George
Alex Farber <alex@kawo2.rwth-aachen.de> wrote in message
news:3799E96F.B773BD10@kawo2.rwth-aachen.de...
> e-bin wrote:
> >
> > I'm obviously fairly new to learning Perl, and was wondering where I
might
> > find a module to send e-mail to users without the use of an e-mail
program
> > such as "sendmail".
>
> Hi,
>
> there was an article on it in the summer TPJ - get the source
> from http://www.itknowledge.com/tpj/programs/Issue_14/Sending_Mail/
>
> Regards
> Alex
>
> --
> (java pref) http://simplex.ru/pref.html
> (pref news) http://simplex.ru/news.html
> (russ.lit.) http://simplex.ru/lit.html




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

Date: 24 Jul 1999 17:40:44 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: output of print map ( { unless (/^#/) {} } ("#") );
Message-Id: <7nctqs$fll$1@news.ml.com>

Tad McClellan <tadmc@metronet.com> wrote:
>   Since you stealth-Cc'ed me, I will not.
>   Stealth Cc'ing makes folks feel mad, not helpful.

Tad, I understand your feeling and I apologize for what trn4 didn't
do what I thought it ought do. I will make a suggestion to the trn
author, unless you have better suggestions. Thank you. 

PS: there could be be indication in the header which your email reader 
decides to hide.

-- 
Michael Wang
http://www.mindspring.com/~mwang


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

Date: 24 Jul 1999 18:47:58 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: output of print map ( { unless (/^#/) {} } ("#") );
Message-Id: <7nd1ou$ge2$1@news.ml.com>

Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>
>This group is meant to be a place to talk about Perl issues.  If
>you don't like it, don't go there.  Your generalization is as
>unwarranted as your exasperation.
 
First of all, thank you for the post. 

I do like to go here and talk about some Perl issues. Try to save people's
time, I trimmed down my program to one line just to demonstarte a "problem", 
but this causes "wiredness". What I want to do is to create a hash from
a file of two columns, but it may have empty lines /^\s*$/, comment lines
/^#/, or comment s:#.*::. So I came up with the following:

%assoc= map({
          if (/^#/ || /^\s*$/) {
            ;  
          } else {
            s:#.*::;
            split;
          }
        } <README>);

What my question/problems are (1) I can not safely "safely" use if/unless
inside the the map block, since as you said, the return value of
if/unless is not defined. And I do not know how can I do without using
if/unless. (2) I can not control what get into return from map to assoc,
for example, /^#/ || /^\s*$/ may return something, s:#.*:: may return
something. In shell, what I want to return, I "echo", what I don't want,
I "> /dev/null". (3) I can not use "last", "next" in map block. For example,
I may want to get one pair from the file README, as soon as I found the
pair, I jump out the loop. 

Any advice to do what I wanted to do above is greatly appreciated. 

>Oh, and when you mail a Cc of your posting, please indicate in
>the text that you have also posted it.  The reason should be
>obvious.

I don't know how can I do this automatically with trn, I will do some
research. Thanks. 
-- 
Michael Wang
http://www.mindspring.com/~mwang


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

Date: 24 Jul 1999 19:00:57 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: output of print map ( { unless (/^#/) {} } ("#") );
Message-Id: <7nd2h9$glm$1@news.ml.com>

Abigail <abigail@delanet.com> wrote:
>?? 
>?? [Asking the same question for the zillionth time]

I missed the "print" statement in the body of post which caused
some confusion. I followed up to make my question clear. I did
not ask the same question for the zillionth time, but thanks for 
your concern and I will take a note not to ask same question
repetatively. Thanks. 

-- 
Michael Wang
http://www.mindspring.com/~mwang


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

Date: 24 Jul 1999 17:33:12 GMT
From: rpjose82@aol.com (RPJOSE82)
Subject: Pattern Matching
Message-Id: <19990724133312.28518.00001761@ng-ch1.aol.com>

I have a script in which the user enters a line, and if this line contains any
odd characters (such as: ? > < ? " : } { + _) I want to use s/// to take these
out and replace them with a null string.  This is what I have so far:

$var =~
s/(\!|\@|\#|\$|\%|\^|\&|\*|\(|\*|\)|\||\+|\=|\[|\]|\}|\{\|'|\"|\;|\:|\/|\\
|\?|\.|\,|\<|\>|\_)+//i;

Needless to say, it doesn't fundtion very well.  Is there a better way to do
this?  Thanks!

R.Joseph


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

Date: Sat, 24 Jul 1999 10:51:48 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: Pattern Matching
Message-Id: <z7nm3.125$Iy.8002@typhoon-sf.snfc21.pbi.net>

I don't know if this is what you're looking for, but it seems like a
wildcard might suite you better in this case:

$var=~ s/[^0-9a-zA-Z]//g;

Which matches any non-word character(i.e. not 0-9, a-z, etc...) and replaces
with null string.  Hope this helps.

George
RPJOSE82 <rpjose82@aol.com> wrote in message
news:19990724133312.28518.00001761@ng-ch1.aol.com...
> I have a script in which the user enters a line, and if this line contains
any
> odd characters (such as: ? > < ? " : } { + _) I want to use s/// to take
these
> out and replace them with a null string.  This is what I have so far:
>
> $var =~
> s/(\!|\@|\#|\$|\%|\^|\&|\*|\(|\*|\)|\||\+|\=|\[|\]|\}|\{\|'|\"|\;|\:|\/|\\
> |\?|\.|\,|\<|\>|\_)+//i;
>
> Needless to say, it doesn't fundtion very well.  Is there a better way to
do
> this?  Thanks!
>
> R.Joseph




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

Date: Sat, 24 Jul 1999 10:54:34 -0700
From: Andrew J Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Pattern Matching
Message-Id: <3799FDDA.4B0B4BF5@mcmahon.qal.berkeley.edu>

RPJOSE82 wrote:

> I have a script in which the user enters a line, and if this line contains any
> odd characters (such as: ? > < ? " : } { + _) I want to use s/// to take these
> out and replace them with a null string.  This is what I have so far:
>
> $var =~
> s/(\!|\@|\#|\$|\%|\^|\&|\*|\(|\*|\)|\||\+|\=|\[|\]|\}|\{\|'|\"|\;|\:|\/|\\
> |\?|\.|\,|\<|\>|\_)+//i;
>

Yuck! This is a job for tr//:

$var =~ tr/a-zA-Z0-9//cd;

This is assuming that by "odd characters" you mean characters that are not
alphanumeric; change the above as necessary to suit.


--
-------------------------------------------------------------
Andrew Perrin - NT/Unix/Access Consulting - aperrin@mcmahon.qal.berkeley.edu
            I'M LOOKING FOR ANOTHER EXPERIENCED ACCESS
               DEVELOPER - CONTACT ME IF INTERESTED.
        http://www.geocities.com/SiliconValley/Grid/7544/
-------------------------------------------------------------




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

Date: Sat, 24 Jul 1999 11:01:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pattern Matching
Message-Id: <MPG.12039f4567972d28989d36@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <19990724133312.28518.00001761@ng-ch1.aol.com> on 24 Jul 1999 
17:33:12 GMT, RPJOSE82 <rpjose82@aol.com> says...
> I have a script in which the user enters a line, and if this line contains any
> odd characters (such as: ? > < ? " : } { + _) I want to use s/// to take these
> out and replace them with a null string.  This is what I have so far:
> 
> $var =~
> s/(\!|\@|\#|\$|\%|\^|\&|\*|\(|\*|\)|\||\+|\=|\[|\]|\}|\{\|'|\"|\;|\:|\/|\\
> |\?|\.|\,|\<|\>|\_)+//i;
> 
> Needless to say, it doesn't fundtion very well.  Is there a better way to do
> this?  Thanks!

Read all about the translation operator 'tr' in perlop.  It is exactly 
what you are looking for.  In particular, you might want to enumerate 
the characters you wish to retain, rather than those you wish to delete 
(see the /cd modifiers).

Note relevant to a current thread on superfluous punctuation:

See what all those unnecessary backslashes tell us about the experience 
level of the programmer?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 24 Jul 1999 12:13:10 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl 4 Source Code or Binaries
Message-Id: <slrn7pjsvv.3fh.abigail@alexandra.delanet.com>

Dr. Who (qwerty@post.utfors.se) wrote on MMCLII September MCMXCIII in
<URL:news:37989C6D.D18CE9A9@post.utfors.se>:
"" hmm ..in sweden Anno is a female name ..
"" - are you? :)

This isn't the football field of a highschool. Grow up.


*plonk*


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 24 Jul 1999 10:08:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl and java
Message-Id: <7nc3ah$14f$1@gellyfish.btinternet.com>

On Fri, 23 Jul 1999 09:12:15 -0700 Marc Simard wrote:
> Hi !
> I jus want to know how can i make my perl script write "print" for
> javascript line so it cna be inserted in my
> web page.
> exemple : print "<STYLE type="text/css">"
>                print "<!-- A.URLTitle  {text-decoration: none;} -->"
> 

Er thats what you are doing isnt it ?  And that isnt Javascript either.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 24 Jul 1999 09:31:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl CGI vs VB ASP
Message-Id: <7nc156$147$1@gellyfish.btinternet.com>

On Fri, 23 Jul 1999 16:18:50 GMT Timothy O'Berton wrote:
> 
>                               Perl's syntax is a lot more clumsy than
> VB. 

I think you'd be backing a loser with that argument here - after all
Visual Basic is still, er, BASIC at heart.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 24 Jul 1999 18:59:44 +0200
From: Marten Lehmann <lehmann@cnm.de>
Subject: Re: perl-DBI-mysql
Message-Id: <3799F100.44F2A02C@cnm.de>

> DBD::mysql::st execute failed: You have an error in your SQL syntax
> near

the only thing I would suspect is that the string to save the sign '
contains. So quote such signs try to use $line=~s/\'/\\\'/g; In the
Mysql-Modul there is a function for this: $data=$dbh->quote($data);


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

Date: Sat, 24 Jul 1999 17:43:57 GMT
From: Klaus Oberecker <klaus.oberecker@gmx.at>
Subject: Re: perl-DBI-mysql
Message-Id: <3799FC57.F544C3BC@gmx.at>

Marten Lehmann wrote:
> 
> > DBD::mysql::st execute failed: You have an error in your SQL syntax
> > near
> 
> the only thing I would suspect is that the string to save the sign '
> contains. So quote such signs try to use $line=~s/\'/\\\'/g; In the
> Mysql-Modul there is a function for this: $data=$dbh->quote($data);



thanks!!! - now it works! - I´ve just quoted the variable $picture ...


 [...]VALUES (0,'Prename','Surename',0,'$picture')"; [...]
                                       -----------

klaus


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

Date: 24 Jul 1999 17:33:29 GMT
From: cho man fai <mfcho7@ie.cuhk.edu.hk>
Subject: program runtime problem..
Message-Id: <7nctd9$pc6$1@eng-ser1.erg.cuhk.edu.hk>

Dear all,

I recently write a program to tail -f the sendmail log file. I assume
the program can be started and run forever to find out any spammer if
they send emails with a number of mails within a period of time. The
program, however, works only for around the first day only but not
afterwards.

I suspect it is owing to the associative arrays growing and excced the
limit (memory? or what?) to hold the sender and relay address. Is there
any limit for that in perl? The array grows in the program and it is
unavoidable. I did try to clear the array periodically, say every hour,
but failed. May you tell me the way to clear the assiciative array or
any workarounds you may think of?

Thanks in advance.

Rgds,
Cho Man Fai


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

Date: Sat, 24 Jul 1999 14:45:40 -0400
From: "Scot Gardner" <Scot@Cyber-Shopper.com>
Subject: Reading Data from a file to a variable?
Message-Id: <932842296.132.52@news.remarQ.com>

I have a script that contains the following

%prices = (
'item1','25.99',
'item2','21.99',
'item3','29.99',
);

etc.etc.

I want to have this list in a seperate delimited data file, lets say
products.db then read the data into the %prices
instead of having them inbeded in the script.

Can someone tell me how to go about this??
I am new to perl, do I use grep?? to get my data??


Thanks


To Your Success

Scot Gardner CIMC
Scot@Cyber-Shopper.com
ICQ#  9440071
Is your business on the Internet?
Go to:  http://www.cyber-shopper.com





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

Date: Sat, 24 Jul 1999 17:36:08 GMT
From: satishc@my-deja.com
Subject: regexp help
Message-Id: <7ncti8$gb0$1@nnrp1.deja.com>

Hello,

I would like to create a regular expression that matches the first of
the following entries in a log file:

blank (new line)
some text of varying length
some text of varying length
some text of varying length
some text of varying length
depending on the entry another line of text
blank (new line)
some text of varying length
some text of varying length
some text of varying length
some text of varying length
depending on the entry another line of text
blank (new line)

etc..

I'm using:
@ARGV = ("textfile.txt");
 	while (<>) {
	if ([m/(^(\n\s {1}).*\s{1}^(\n\s {1}))/]) {
	print $_;

}
}

However it returns the entire set of records not just the first one.
Could someone please help me figure out what I'm doing wrong?

I'd also like to be able to have a user parse by an entry on the second
line of a record, but have the entire entry returned, not just the
second line.  At this point it seems that I should have the individual
entries fed as elements into an array and then perform some type of
search operation on each array element returning only those that match
the criteria specified by the user.  Any ideas if this is this remotely
correct?

Thank You
satishc@netzero.net



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sat, 24 Jul 1999 18:36:20 GMT
From: satishc@my-deja.com
Subject: regexp help
Message-Id: <7nd133$ihg$1@nnrp1.deja.com>

--please disregard if this message has already posted, my network
connection was interrupted during the first attempt.

Thanks

Hello,

I would like to create a regular expression that matches the first of
the following entries in a log file:

blank (new line)
some text of varying length
some text of varying length
some text of varying length
some text of varying length
depending on the entry another line of text
blank (new line)
some text of varying length
some text of varying length
some text of varying length
some text of varying length
depending on the entry another line of text
blank (new line)

etc..

I'm using:
@ARGV = ("textfile.txt");
 	while (<>) {
	if ([m/(^(\n\s {1}).*\s{1}^(\n\s {1}))/]) {
	print $_;

}
}

However it returns the entire set of records not just the first one.
Could someone please help me figure out what I'm doing wrong?

I'd also like to be able to have a user parse by an entry on the second
line of a record, but have the entire entry returned, not just the
second line.  At this point it seems that I should have the individual
entries fed as elements into an array and then perform some type of
search operation on each array element returning only those that match
the criteria specified by the user.  Any ideas on if this is this
remotely correct?

Thank You




Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Sat, 24 Jul 1999 18:52:09 +0100
From: Andy Mendelsohn <andy@focus-consulting.co.uk>
To: Marten Lehmann <lehmann@cnm.de>
Subject: Re: split([tabulator],$line );
Message-Id: <3799FD49.A39F45DC@focus-consulting.co.uk>

[copied to author]

Marten Lehmann wrote:
> 
> Hello,
> 
> how can I split a line by the sign of the tabulator?

By learning how to use split. I suggest perldoc -f split as a starting
point. Once you understand how to use split, invoke the magic 'perldoc
perlre' and keep your eyes peeled for the special incantation required
to identify the sign of the tabulator.

hth
andy


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

Date: Sat, 24 Jul 1999 10:55:27 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: split([tabulator],$line );
Message-Id: <KPnm3.146$Iy.6476@typhoon-sf.snfc21.pbi.net>

split(m"\t", $line);

I think....

George
Marten Lehmann <lehmann@cnm.de> wrote in message
news:3799F03F.E2E9B491@cnm.de...
> Hello,
>
> how can I split a line by the sign of the tabulator?




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

Date: Sat, 24 Jul 1999 10:55:27 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: split([tabulator],$line );
Message-Id: <9Tnm3.152$Iy.9827@typhoon-sf.snfc21.pbi.net>

split(m"\t", $line);

I think....

George
Marten Lehmann <lehmann@cnm.de> wrote in message
news:3799F03F.E2E9B491@cnm.de...
> Hello,
>
> how can I split a line by the sign of the tabulator?




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

Date: 24 Jul 1999 09:26:04 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Telnet via CGI?
Message-Id: <7nc0rc$144$1@gellyfish.btinternet.com>

On Fri, 23 Jul 1999 19:05:11 -0400 c.s. wrote:
> 
> wrote in message <7namju$vi6$1@nnrp1.deja.com>...
>>You can use Comm.pl module. This comes with samlpe
>>code - how to telnet into remote machine via a
>>script. It uses "expect" commands to do this.
>>Harish M.
> 
> 
> What is an "expect command"?
> 

NAME
       expect  -  programmed  dialogue with interactive programs,
       Version 5

SYNOPSIS
       expect [ -dDinN ] [ -c cmds ] [ -[f|b] ] cmdfile ] [ args ]

INTRODUCTION
       Expect is a program that "talks" to other interactive pro­
       grams according to a script.  Following the script, Expect
       knows  what  can  be  expected from a program and what the
       correct response should be.

Hope that helps

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 24 Jul 1999 10:48:23 -0800
From: argouarc@idiom.com (Argouarch)
Subject: Variables in Regx?
Message-Id: <argouarc-2407991048240001@argouarc.dial.idiom.com>
Keywords: regx,perl

Here's the problem, I have a dictionary flat file with 30 000 lines, I
want to bold every instance of the defined word in each definition so my
regular expresion has to change for each line (sure dont want to do this
by hand, and was'nt PERL designed just for this crap :=)?. 
I also want the html tags inserted in the file itself so I wrote a simple
utility script to change the file.

I tried this:
Open...
While (<FILE>){
($key,$translation)=split(/:/);

s/(${$key})/<b>$1<\/b>/g;
}

would not work... although I am forcing dereferencing of $key, (I also
tried dereferencing on both side and naively a /$key/<b>$key<\/b>/). It
seems that perl allows variables only on the left side like with the
modifiers e and ee ?!?
Am I missing something here? 
Philippe


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 244
*************************************


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