[9460] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3052 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 3 16:17:02 1998

Date: Fri, 3 Jul 98 13:08:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 3 Jul 1998     Volume: 8 Number: 3052

Today's topics:
        Problems if print <<END_of_PRINT <altenbur@ncsa.uiuc.edu>
    Re: Problems if print <<END_of_PRINT (Craig Berry)
        problems with creating new directories <rmullen@mcmail.com>
    Re: problems with creating new directories (Matt Knecht)
    Re: problems with creating new directories (Josh Kortbein)
    Re: problems with creating new directories (brian d foy)
    Re: Programming for MS SQLServer - recommendations? <frankie@etsetb.upc.es>
        ptkdb Vers 1.03 GUI Based Debugger for Perl Unix/Win95/ (Andrew E Page)
        public news server sidneyp@mailbank.com
    Re: public news server (brian moore)
    Re: public news server (Josh Kortbein)
        Pushing onto array using reference <melkor@Cal040031.student.utwente.nl>
    Re: Pushing onto array using reference (Craig Berry)
    Re: Pushing onto array using reference <danboo@negia.net>
    Re: Pushing onto array using reference (Josh Kortbein)
    Re: Pushing onto array using reference (Abigail)
    Re: question about objects (Charlie Stross)
        read files/directories 'above' script <3pound.fuckinspammers.@iname.com>
        Redirecting output? <bth@acsu.buffalo.edu>
    Re: Redirecting output? (Craig Berry)
    Re: Redirecting output? <efinch@cais.com>
    Re: Regular expression matech for ( non-fixed number of S_Diwell@my-dejanews.com
    Re: Regular expression matech for ( non-fixed number of (Michael Wang)
    Re: Regular expression matech for ( non-fixed number of (Michael Wang)
    Re: Regular expression matech for ( non-fixed number of (Josh Kortbein)
    Re: require $redir.'setup.pl'; ?? (Craig Berry)
    Re: Rexx perl translator (Linda Littleton)
    Re: Rexx perl translator <flavell@mail.cern.ch>
    Re: Rexx perl translator (Linda Littleton)
    Re: Rexx perl translator (Brandon S. Allbery KF8NH)
    Re: Running Unix Script in Perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 02 Jul 1998 16:46:43 -0500
From: david lee altenburg <altenbur@ncsa.uiuc.edu>
Subject: Problems if print <<END_of_PRINT
Message-Id: <359BFFC3.6FAB15EE@ncsa.uiuc.edu>

Has anyone had this happen?

I have a lot of code.  Then I get to print.  The following lines are
taken
from my broken code:

# lots o' code here

      print <<END_of_HTML;

        Some stuff I printed here
         Yes, it's  a web page.

END_of_HTML

# lots more code


Anyway, I keep getting the following error:

"Can't find string terminator "END_of_HTML" anywhere before EOF at
 ./editstudent.cgi line 285."


It's there, it's on a line all by itself, it's up against the left
margin...apparently
there's another pitfall about using this format that I've managed to
avoid up
until now.  If anyone can shed light on this, I'd really appreciate it.

Thanks,

David Altenburg
altenbur@ncsa.uiuc.edu



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

Date: 2 Jul 1998 22:02:59 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Problems if print <<END_of_PRINT
Message-Id: <6nh02j$kt5$4@marina.cinenet.net>

david lee altenburg (altenbur@ncsa.uiuc.edu) wrote:
: Has anyone had this happen?

All too often.

: I have a lot of code.  Then I get to print.  The following lines are
: taken from my broken code:
: 
:       print <<END_of_HTML;
: 
:         Some stuff I printed here
:          Yes, it's  a web page.
: 
: END_of_HTML
: 
: Anyway, I keep getting the following error:
: 
: "Can't find string terminator "END_of_HTML" anywhere before EOF at
: ./editstudent.cgi line 285."
: 
: It's there, it's on a line all by itself, it's up against the left
: margin...apparently there's another pitfall about using this format that
: I've managed to avoid up until now.  If anyone can shed light on this,
: I'd really appreciate it.

Check for spaces/tabs to the right of the string terminator.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 02 Jul 1998 19:12:14 +0100
From: Ross Mullen <rmullen@mcmail.com>
Subject: problems with creating new directories
Message-Id: <359BCD7E.D874D555@mcmail.com>

I wonder if anyone can help me out. The problem is making directories, I
wish to create a directory within a directory by specifying the new
directory as a name entered by the user e.g.
mkdir("/home/dynamic/$name",777); I have used every syntax imaginable
when using this command but it just wont work. I have also used the open
command using the mkdir but this also refuses to work. The file modes on
the parent directory are all set to r/w/e.

So could anyone have a look and possibly give a working syntax,

Thanks very much



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

Date: Thu, 02 Jul 1998 18:17:44 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: problems with creating new directories
Message-Id: <c9Qm1.64$Du.895854@news2.voicenet.com>

Ross Mullen <rmullen@mcmail.com> wrote:
>mkdir("/home/dynamic/$name",777); I have used every syntax imaginable

Your mission, should you choose to accept it is to read the following
items, in the following order:

perldoc -f mkdir
perldoc -f umask
perldoc -f oct

This should take you about 5 minutes, tops, considering it's only 31
lines of documentation.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: 2 Jul 1998 18:38:19 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: problems with creating new directories
Message-Id: <6ngk2r$s3n$1@news.iastate.edu>

Ross Mullen (rmullen@mcmail.com) wrote:
: I wonder if anyone can help me out. The problem is making directories, I
: wish to create a directory within a directory by specifying the new
: directory as a name entered by the user e.g.
: mkdir("/home/dynamic/$name",777); I have used every syntax imaginable
: when using this command but it just wont work. I have also used the open
: command using the mkdir but this also refuses to work. The file modes on
: the parent directory are all set to r/w/e.

In addition to the other responses to your query, note that you should
be checking the return value of mkdir() if you're not in your actual
code. It might give you some hints as to why your code isn't working.

mkdir($filename, $mode) or die "mkdir failed: $!\n";

Josh

--

_________________________________________________________
I do not trust your bitch.
	- Frederich Nietzche, in _Also Sprach Zarathustra_



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

Date: Thu, 02 Jul 1998 15:25:35 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: problems with creating new directories
Message-Id: <comdog-ya02408000R0207981525350001@news.panix.com>
Keywords: from just another new york perl hacker

In article <359BCD7E.D874D555@mcmail.com>, Ross Mullen <rmullen@mcmail.com> posted:

>I wonder if anyone can help me out. The problem is making directories, I
>wish to create a directory within a directory by specifying the new
>directory as a name entered by the user e.g.
>mkdir("/home/dynamic/$name",777); I have used every syntax imaginable
>when using this command but it just wont work.

there are a lot of things that might mean "won't work".

perhaps by "won't work" you mean "doesn't do what i think it
is supposed to do, but still does something". usually, showing
what it does will help someone help you...

try using an octal number to specify the mode (which is 
normally represented in octal.  decimal 777 does not have
the same bit pattern as octal 0777!)

   mkdir("/home/dynamic/$name", 0777) or die $!;

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers T-shirts! <URL:http://www.pm.org/tshirts.html>


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

Date: Thu, 02 Jul 1998 20:14:07 +0200
From: Francesc Guasch <frankie@etsetb.upc.es>
To: Ritche Macalaguim <ritche@san.rr.com>
Subject: Re: Programming for MS SQLServer - recommendations?
Message-Id: <359BCDEF.CE100235@etsetb.upc.es>

Ritche Macalaguim wrote:
> 
> May someone please recommend any good books on programming Perl for
> Microsoft's SQLServer... as well as any other sources to try...
> 
http://www.hermetica.com/
-- 
mailto:frankie@etsetb.upc.es	http://www.etsetb.upc.es/~frankie
 ^-^.-----,       
 o o _     )        		Linux, Windows 95, and Windows NT
  Y (_, (__(Ssss    (also known as the Good, the Bad, and the Ugly)


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

Date: Fri, 3 Jul 1998 12:31:04 GMT
From: aep@world.std.com (Andrew E Page)
Subject: ptkdb Vers 1.03 GUI Based Debugger for Perl Unix/Win95/NT
Message-Id: <EvIqrs.9JJ@world.std.com>



ptkdb  A  Perl debugger with Graphical User Interface

You can find this utility with at:

<a href="http://world.std.com/~aep/ptkdb">http://world.std.com/~aep/ptkdb</a>

http://world.std.com/~aep/ptkdb

The page contains links to lastest releases of perlTk and to 
binaries of perl5.004 for Win95/NT with Tk installed.


New Version 1.03


Release Notes.

New Feature...   Expression Evaluation window
New Feature...   Configuration save/restore
New Feature...   Control-C stops scripts and enters debugger
Bug Fix:  Variables not scoped with 'my' in breakpoint
expressions were not being evalled properly.  
Bug Fix:  Evaluation of certain 'CODE' ref variables
caused the debugger to fail and exit.  
Bug Fix:  Debugger did not properly handle scripts entered through STDIN.  
Added a Tk::Adjuster to the main window to adjust the size
of the code and expression windows.
Environmental variables to control appearence and configuration
Line numbers have been added
Making old versions avaliable for download
-- 
Andrew E. Page   (Warrior Poet) |   Decision and Effort The Archer and Arrow
Software Engineering Consultant |     The difference between what we are
Unix, Mac, C/C++/Java, Perl, NT |           and what we want to be.


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

Date: Thu, 02 Jul 1998 20:38:49 GMT
From: sidneyp@mailbank.com
Subject: public news server
Message-Id: <6ngr4q$pjq$1@nnrp1.dejanews.com>

I am looking for an access to a public news server to get comp.lang.perl.misc
news group.  Right now I am using dejanew but they keep only very limited
number of articles.

Any segusstins Please.


Sidney

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 3 Jul 1998 00:13:56 GMT
From: bem@news.cmc.net (brian moore)
Subject: Re: public news server
Message-Id: <slrn6po8ib.dms.bem@thorin.cmc.net>

On Thu, 02 Jul 1998 20:38:49 GMT, 
 sidneyp@mailbank.com <sidneyp@mailbank.com> wrote:
> I am looking for an access to a public news server to get comp.lang.perl.misc
> news group.  Right now I am using dejanew but they keep only very limited
> number of articles.

Um, Dejanews has far more articles in clpm than anyone I've ever heard
of.

-- 
Brian Moore                             Kill A Spammer For Jesus
Sysadmin, C/Perl Hacker, Usenet Vandal 


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

Date: 3 Jul 1998 18:26:38 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: public news server
Message-Id: <6nj7ou$j49$2@news.iastate.edu>

sidneyp@mailbank.com wrote:
: I am looking for an access to a public news server to get comp.lang.perl.misc
: news group.  Right now I am using dejanew but they keep only very limited
: number of articles.

A very limited number of articles? For what values of "very limited?"


Josh

--

________________________________________________________________________
Interviewer: "So Frank, you have long hair. Does that make you a woman?"
Frank Zappa: "You have a wooden leg. Does that make you a table?"



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

Date: 2 Jul 1998 21:29:32 GMT
From: Thomas van Gulick <melkor@Cal040031.student.utwente.nl>
Subject: Pushing onto array using reference
Message-Id: <6ngu3s$ang$1@dinkel.civ.utwente.nl>

I can't seem to push values onto an array of which I only have a reference.
I can make a copy of the array, push there and then update the reference,
but that isn't very neat at all. Anyknow if it can be done?

Thomas
-- 
http://utumno.student.utwente.nl/
melkor@utumno.student.utwente.nl


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

Date: 2 Jul 1998 21:44:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Pushing onto array using reference
Message-Id: <6ngv05$kt5$3@marina.cinenet.net>

Thomas van Gulick (melkor@Cal040031.student.utwente.nl) wrote:
: I can't seem to push values onto an array of which I only have a reference.
: I can make a copy of the array, push there and then update the reference,
: but that isn't very neat at all. Anyknow if it can be done?

  my @array = qw(1 2 3);
  my $ar    = \@array;     
  push @$ar, 4;         
  print "@$ar\n";

Output: 1 2 3 4

The key realization is that the first arg to push has to have an @ on the
front.  I know that's a crude way to put it, but it serves as a useful
rule. 

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 02 Jul 1998 18:03:01 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Pushing onto array using reference
Message-Id: <359C0395.233B45CF@negia.net>

Thomas van Gulick wrote:
> 
> I can't seem to push values onto an array of which I only have a reference.
> I can make a copy of the array, push there and then update the reference,
> but that isn't very neat at all. Anyknow if it can be done?

how did you copy the array ref? did you have to dereference it at some
point? well you would do the same thing using 'push':

$foo = [];
push @{ $foo }, 'bar';  # dereference in place
print @{ $foo };

cheers,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: 2 Jul 1998 21:52:23 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Pushing onto array using reference
Message-Id: <6ngven$gs1$1@news.iastate.edu>

Thomas van Gulick (melkor@Cal040031.student.utwente.nl) wrote:
: I can't seem to push values onto an array of which I only have a reference.
: I can make a copy of the array, push there and then update the reference,
: but that isn't very neat at all. Anyknow if it can be done?

Is this what you mean?

/home/kortbein% perl5 -w ref.pl
123456
/home/kortbein% cat ref.pl
#!/usr/local/bin/perl5 -w

@a = (1, 2, 3);
$aref = \@a;

push(@$aref, 4, 5, 6);

print @a, "\n";


It seems to work fine for me.

[
System info:

This is perl, version 5.004_04 built for axp-dec_osf
OSF1 isua3.iastate.edu V4.0 878 alpha

]

Josh

--

________________________________________________________________________
Interviewer: "So Frank, you have long hair. Does that make you a woman?"
Frank Zappa: "You have a wooden leg. Does that make you a table?"



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

Date: 3 Jul 1998 10:03:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Pushing onto array using reference
Message-Id: <6niaa7$dg5$6@client3.news.psi.net>

Thomas van Gulick (melkor@Cal040031.student.utwente.nl) wrote on MDCCLXVI
September MCMXCIII in <URL: news:6ngu3s$ang$1@dinkel.civ.utwente.nl>:
++ I can't seem to push values onto an array of which I only have a reference.
++ I can make a copy of the array, push there and then update the reference,
++ but that isn't very neat at all. Anyknow if it can be done?


Yes.

The key thing to remember is that anywhere you see @indentifier, you
can replace it with @{expression resulting in a reference to an array}.

So, if your reference is $arrayref, then you procees as follows:

Normally, you would do:

      push @array, $one, $two, $three;

Now apply what I said in the first paragraph, and you get:

      push @{$arrayref}, $one, $two, $three;


Now, because @{$variable} is quite common in Perl, you may also
omit the {}, giving you

      push @$arrayref, $one, $two, $three;

However, I won't advice that. Using {}'s is never wrong, but omitting
them can be.




Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: Fri, 03 Jul 1998 12:43:42 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: question about objects
Message-Id: <slrn6ppkj3.leb.charlie@cs.ed.datacash.com>

John Porter <jdporter@min.net> wrote:

>Charlie Stross wrote:
>> >require "./point.pm";
>> 
>> You used require() instead of use() to load your module. Consequently
>> stuff you put in it shows up in the namespace point, as opposed to MAIN.
>
>Wrong.  Please don't post nonfactual blather.  You're only going to
>screw up an impressionable newbie even worse.  For shame.

Would you care to explain that? As far as I'm aware, require() doesn't
import anything.

>(And you meant "main" anyway, not "MAIN".)

Yup; guilty as charged. (I've been spending too much time with case-
insensitive stuff lately.)

   :
 [ snip ]
   :
>> sub x {
>>    # set or get the X axis coordinate; return zero if coordinate is zero
>
>Why would you do this?  Should the caller never be allowed to set x to 
>zero?  Come on.

Because it was implied by my reading of the original problem; that the
issue of which quadrant a point is in is undecidable if either
coordinate is zero. Of course, how you deal with this is now a religious
issue; do you rely on the programmer to check their input, or build
it into the module?

   :
>> NB: Yes: this is verbose and bulky, and half those if statements could be
>> replaced by the ternary operator, and a version where new() accepts x,y
>> coordinates as an initializer would be shorter. But I'd like to think it's
>> also clear and readable. If it isn't, please tell me why.
>
>Holy crow. 
>Rob's original version of quadrant() was MUCH more concise and readable!
>Rob also had
>	my $self = shift;
>which is standard, correct perl idiom.  

It's standard, correct, and idiomatic. 

I dislike reliance on idiom; the implicit use of $_ and @_ in
particular. Yeah, they're handy -- but it's a royal pain in the ass
when you have to hand over code to someone who, in the phrase of
someone I had to deliver to, "has not yet been assimilated by the perl
hive mind".

>Also, why bother with elsif's when each block does a return?

Good point. Can I plead guilty to wanting clarity here?  Anything 
functionally equivalent to a case statement will do the job: the
choice of what to use depends on where your priorities lie.

I'd rather see ten lines of code which are utterly transparent to
a newbie than two lines of code which do the same job but require a
Christiansen to make sense of: this is because it is hard to get
hold of a tchrist when you need one, and I place maintainability
at the top of my list of priorities when coding. (If this makes
my style seem rather horrifyingly verbsoe, well, so be it.)



-- Charlie


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

Date: Thu, 2 Jul 1998 07:28:23 -0500
From: "Jay" <3pound.fuckinspammers.@iname.com>
Subject: read files/directories 'above' script
Message-Id: <6nfua7$156q$1@newssvr04-int.news.prodigy.com>

(NT/95 AW5.003) Rather than manually piping a "dir /s" to a file I was
trying to incorporate a system call to index all my drives..

Thinking nothing of it, I was running the script from a subdirectory on F:

Strangely though, even after I tried a chdir('f:\'), chdir("f\:\\") and a
system('cd f\:\\')...etc... it would index all drives correctly, except on
the F: drive, where it would start with the subdirectory the script was run
from.

I opted to move the script to the root of that drive and it works fine.

But, doesn't that seem a little weird?

Thanks..

-Jay




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

Date: Thu, 2 Jul 1998 15:09:30 -0400
From: Bryan T Hoch <bth@acsu.buffalo.edu>
Subject: Redirecting output?
Message-Id: <Pine.GSO.3.96.980702150602.9637B-100000@callisto.acsu.buffalo.edu>

Hello.
I'm writing a Perl program that executes a system call to see who is
logged in on the server, but whenever it makes that system call it always
sends its output to the screen. I don't want that. Is there anyway that I
can have the output redirected into an array within the program that
called it?

Here is some relavent code:

        if ((system "rusers -l $hostA | fgrep $personA") == 0){
            push(@logged_on, $personA."@".$hostA);
            print $logged_on[i];
            $x++;

Any help would be appreciated. Thanks.
						Bryan H




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

Date: 2 Jul 1998 20:32:52 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Redirecting output?
Message-Id: <6ngqpk$h65$1@marina.cinenet.net>

Bryan T Hoch (bth@acsu.buffalo.edu) wrote:
: I'm writing a Perl program that executes a system call to see who is
: logged in on the server, but whenever it makes that system call it always
: sends its output to the screen. I don't want that. Is there anyway that I
: can have the output redirected into an array within the program that
: called it?
: 
: Here is some relavent code:
: 
:         if ((system "rusers -l $hostA | fgrep $personA") == 0){

I'm not sure how you're trying to collect output in that line.  In any
case, use backticks `` instead of system:

  `rusers -l $hostA | fgrep $personA`;

  if ($? == 0) {

:             push(@logged_on, $personA."@".$hostA);

You can do that without explicit concatenation:

    push @logged_on, "$personA\@$hostA";

:             print $logged_on[i];

That's a syntax error.  To print the last entry (the one just appended,
either assign it to a my var then both push and print that, or do

    print $logged_on[-1];

:             $x++;

Where did $x come from?

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Fri, 03 Jul 1998 12:45:36 -0400
From: Ed Finch <efinch@cais.com>
Subject: Re: Redirecting output?
Message-Id: <359D0AB0.20B643@cais.com>

Craig Berry wrote:

> :
> :         if ((system "rusers -l $hostA | fgrep $personA") == 0){
>
> I'm not sure how you're trying to collect output in that line.  In any
> case, use backticks `` instead of system:
>
>   `rusers -l $hostA | fgrep $personA`;

Don't do that. The backticks cause perl to collect the output from the command
in anticipation that it will be assigned to a variable.
--
Ed

     Microsoft Windows: the Budweiser of operating systems.




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

Date: Thu, 02 Jul 1998 09:01:49 GMT
From: S_Diwell@my-dejanews.com
Subject: Re: Regular expression matech for ( non-fixed number of () pairs )?
Message-Id: <6nfi9s$19s$1@nnrp1.dejanews.com>

You will find the following AWK & SED will do the job for you.

awk '/\(SID_NAME=/ {print $0}' listener.ora |
    sed 's/\(.*\)\(SID_NAME=.*\)\().*\)/\2/'

Regards,
        Steve.


In article <6nei6q$n8n$1@mathserv.mps.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
>
> [A complimentary Cc of this posting was sent to Michael Wang
> <mwang@tech.cicg.ml.com>],
> who wrote in article <6ne4rv$d2q$1@news.ml.com>:
> > I want to take out
> > SID_LIST_listener_name=( ...
> >                        )
> > from the following text. Can perl/shell/sed/awk do this? Or I need to
> > resort to lex/yacc? Thanks.
> >
> > What I want to do is to find SID_NAME=SID, but I do not want to find
> > it from wrong place. Please note the following text is of free format
> > following some rules.
> >
> > other similar stuff in listener.ora
> > SID_LIST_listener_name=[(SID_LIST=]
> >                                 (SID_DESC=
> >                                    (GLOBAL_DBNAME=global_database_name)
> >                                    (SID_NAME=SID)
> >                                    (operating_system_specific_
> >                                      string=db_location)
> >                                 )
> >                                 [(SID_DESC=
> >                                    (GLOBAL_DBNAME=global_database_name)
> >                                    (SID_NAME=SID)
> >                                    (operating_system_specific_
> >                                     string=db_location)
> >                                 )]
> >                             [)]
> > other similar stuff in listener.ora
>
> Yes, but you need a bleeding-edge perl (or wait a couple of weeks),
> and it is still hard.
>
> Ilya
>


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 2 Jul 1998 13:48:04 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: Regular expression matech for ( non-fixed number of () pairs )?
Message-Id: <6ng32k$so2$1@news.ml.com>

The problem with the following sed/awk solution is
there are other similar blocks of codes
SID_LIST_listener_name1=(...
                        (SID_NAME=SID)
                        )
SID_LIST_listener_name2=(...
                        (SID_NAME=SID)
                        )
And I want the SID_NAME from certain block.

I think the best way is to use the same rule to parse the file
as the file itself is written. But I do not know how to parse
(
 ((())) (()) () ...
)

In article <6nfi9s$19s$1@nnrp1.dejanews.com>,
 <S_Diwell@my-dejanews.com> wrote:
>You will find the following AWK & SED will do the job for you.
>
>awk '/\(SID_NAME=/ {print $0}' listener.ora |
>    sed 's/\(.*\)\(SID_NAME=.*\)\().*\)/\2/'
>
>Regards,
>        Steve.
>
>> > other similar stuff in listener.ora
>> > SID_LIST_listener_name=[(SID_LIST=]
>> >                                 (SID_DESC=
>> >                                    (GLOBAL_DBNAME=global_database_name)
>> >                                    (SID_NAME=SID)
>> >                                    (operating_system_specific_
>> >                                      string=db_location)
>> >                                 )
>> >                                 [(SID_DESC=
>> >                                    (GLOBAL_DBNAME=global_database_name)
>> >                                    (SID_NAME=SID)
>> >                                    (operating_system_specific_
>> >                                     string=db_location)
>> >                                 )]
>> >                             [)]
>> > other similar stuff in listener.ora


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

Date: 2 Jul 1998 13:51:12 GMT
From: mwang@tech.cicg.ml.com (Michael Wang)
Subject: Re: Regular expression matech for ( non-fixed number of () pairs )?
Message-Id: <6ng38g$so2$2@news.ml.com>

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>
>Yes, but you need a bleeding-edge perl (or wait a couple of weeks),
>and it is still hard.
>
what is a "bleeding-edge" perl? What I have is a "5.004_04" perl.


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

Date: 2 Jul 1998 21:39:06 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Regular expression matech for ( non-fixed number of () pairs )?
Message-Id: <6ngulq$q72$5@news.iastate.edu>

Michael Wang (mwang@tech.cicg.ml.com) wrote:
: Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
: >
: >Yes, but you need a bleeding-edge perl (or wait a couple of weeks),
: >and it is still hard.
: >
: what is a "bleeding-edge" perl? What I have is a "5.004_04" perl.

The current beta release, I believe.



Josh

--

________________________________________________________________________
Interviewer: "So Frank, you have long hair. Does that make you a woman?"
Frank Zappa: "You have a wooden leg. Does that make you a table?"



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

Date: 2 Jul 1998 04:57:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: require $redir.'setup.pl'; ??
Message-Id: <6nf40a$kk5$1@marina.cinenet.net>

Penn White (pwhite@nospamsurfsouth.com) wrote:
: >Does that help?
: 
: Very much.  I see exactly what you mean.  I was letting the 'period' after
: $redir confuse me - forgot about concatention.  I still can't find where the
: author of the script is defining $redir, however.  Does it have to be
: defined or is it some sort of reserved word in perl?

Not a reserved word.  If undefined, and if use strict is not in effect, it
will behave like an empty string (and issue a warning under -w).

: Why doesn't he just say
: 
: require 'setup.pl';

Presumably either (a) you've missed the place he initializes $redir, or
(b) it's really undefined, and its presence in the require line is a
harmless but meaningless leftover from some previous version of the code. 
(The latter sort of thing is very common...I call it 'fossil code'). 

: Sorry if these are stupid questions.

Not at all.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 02 Jul 1998 11:48:06 -0400
From: xxx@psu.edu (Linda Littleton)
Subject: Re: Rexx perl translator
Message-Id: <xxx-0207981148060001@rose.cac.psu.edu>

In article <35999EA1.AB3B891A@homer.louisville.edu>, Joe Spears
<jlspea01@homer.louisville.edu> wrote:

> > I am working on a program to translate rexx code written using xedit on
> > a vm mainframe system into EXECUTABLE code written in perl for a unix
> > system, using perl 5.0.
> >

There's a version of Rexx for Unix called uni-Rexx. Have you looked into
that? I can look up the contact info if anyone is interested.


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

Date: Thu, 2 Jul 1998 18:13:49 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Rexx perl translator
Message-Id: <Pine.HPP.3.95a.980702181015.12692I-100000@hpplus10.cern.ch>

On Thu, 2 Jul 1998, Linda Littleton wrote:

> In article <35999EA1.AB3B891A@homer.louisville.edu>, Joe Spears
> <jlspea01@homer.louisville.edu> wrote:
> 
> > > I am working on a program to translate rexx code written using xedit on
> > > a vm mainframe system into EXECUTABLE code written in perl for a unix
> > > system, using perl 5.0.

> There's a version of Rexx for Unix called uni-Rexx. Have you looked into
> that? 

I suspect from the explicit reference to "using xedit" that there is
more to it than merely running a rexx script.  AFAIR it was a popular
pastime in rexx scripts on VM to use xedit as a display manager, and
that would make it a much more interesting problem - indeed, I would
expect the application would need to be re-engineered to run on unix
systems, even if it was still written in rexx.

-- 

       "I realise this is deeply un-knuthian, since it involves producing a
        potentially comprehensible error message" - Robin Fairbairns




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

Date: Thu, 02 Jul 1998 16:32:33 -0400
From: xxx@psu.edu (Linda Littleton)
Subject: Re: Rexx perl translator
Message-Id: <xxx-0207981632330001@rose.cac.psu.edu>

In article <Pine.HPP.3.95a.980702181015.12692I-100000@hpplus10.cern.ch>,
"Alan J. Flavell" <flavell@mail.cern.ch> wrote:

> > There's a version of Rexx for Unix called uni-Rexx. Have you looked into
> > that? 
> 
> I suspect from the explicit reference to "using xedit" that there is
> more to it than merely running a rexx script.  AFAIR it was a popular
> pastime in rexx scripts on VM to use xedit as a display manager, and
> that would make it a much more interesting problem - indeed, I would
> expect the application would need to be re-engineered to run on unix
> systems, even if it was still written in rexx.

There's also a uni-Xedit available from the same company. I think they're
called the Workstation Group.


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

Date: 2 Jul 1998 19:56:40 -0400
From: allbery@kf8nh.apk.net (Brandon S. Allbery KF8NH)
Subject: Re: Rexx perl translator
Message-Id: <6nh6no$bek$1@rushlight.kf8nh.apk.net>

Also sprach "Alan J. Flavell" <flavell@mail.cern.ch> (<Pine.HPP.3.95a.980702181015.12692I-100000@hpplus10.cern.ch>):
+-----
| On Thu, 2 Jul 1998, Linda Littleton wrote:
| > In article <35999EA1.AB3B891A@homer.louisville.edu>, Joe Spears
| > <jlspea01@homer.louisville.edu> wrote:
| > > > I am working on a program to translate rexx code written using xedit on
| > > > a vm mainframe system into EXECUTABLE code written in perl for a unix
| > > > system, using perl 5.0.
| > There's a version of Rexx for Unix called uni-Rexx. Have you looked into
| > that? 
| I suspect from the explicit reference to "using xedit" that there is
| more to it than merely running a rexx script.  AFAIR it was a popular
+--->8

If true, there are basically two options:

(1) nvi's Perl interface (see CPAN);
(2) punt to GNU Emacs and write it in elisp.

(It went both ways as well:  REXX was the "extension language" for XEDIT.  I
found it useful to think of XEDIT as Emacs with an IBM accent, although E/EPM
from the PC-DOS / OS/2 world is probably closer to that description.)

-- 
brandon s. allbery	[os/2][linux][solaris][japh]	 allbery@kf8nh.apk.net
system administrator	     [WAY too many hats]	   allbery@ece.cmu.edu
electrical and computer engineering
carnegie mellon university			   (bsa@kf8nh is still valid.)


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

Date: 01 Jul 1998 10:03:51 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Running Unix Script in Perl
Message-Id: <7xbtram1zs.fsf@beavis.vcpc.univie.ac.at>

Re: Running Unix Script in Perl, Steve
<steve.leach@virgin.net> said:

Steve> Is it possible to run a unix script from within a
Steve> perl script.  If so HOW ? (its got me stuck).

What is a "unix script"?  Do you mean you have an existing
shell script and you want perl to act as a wrapper that
invokes the shell script, possibly passing parameters to it?

If so, "perldoc -f system" will be a good start, followed by
"perldoc perlipc".

It would help everyone a great deal if you showed some
sample code to illustrate the problems you are having and
include intended results and what actually happens.
Contrary to usual c.l.p.m expectations, most posters here
aren't normally psychic :-)

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

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

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