[30214] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1457 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 22 16:22:29 2008

Date: Tue, 22 Apr 2008 13:22:21 -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           Tue, 22 Apr 2008     Volume: 11 Number: 1457

Today's topics:
    Re: How to know if data is piped into my script <news1234@free.fr>
        how to parse from the end? <ela@yantai.org>
        How to print question <mmccaws@comcast.net>
    Re: How to print question <1usa@llenroc.ude.invalid>
    Re: How to print question <ben@morrow.me.uk>
    Re: How to print question <mmccaws@comcast.net>
    Re: How to print question <jurgenex@hotmail.com>
    Re: How to print question (Steven M. O'Neill)
    Re: How to print question <mmccaws@comcast.net>
    Re: How to print question <joe@inwap.com>
        How to record .asx files stpra123@gmail.com
        HTTP::Recorder and WWW::Mechanize for testing web sites <mikaelb@df.lth.se>
        I'd like a macro-processor as in classic book "software (David Combs)
        Ignore empty lines and ones that start w/... <travis.bowers@gmail.com>
    Re: Ignore empty lines and ones that start w/... <peter@makholm.net>
    Re: Ignore empty lines and ones that start w/... <atul.khot@gmail.com>
    Re: Ignore empty lines and ones that start w/... <travis.bowers@gmail.com>
    Re: Ignore empty lines and ones that start w/... (Jens Thoms Toerring)
    Re: Ignore empty lines and ones that start w/... <1usa@llenroc.ude.invalid>
    Re: Ignore empty lines and ones that start w/... <JustMe@somewhere.de>
    Re: Looking for a utility that lists all the functions  <kkeller-usenet@wombat.san-francisco.ca.us>
        Looking for a utility that lists all the functions unde <avner-moshkovitz@shaw.ca>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 16 Apr 2008 08:38:49 +0200
From: nntpman68 <news1234@free.fr>
Subject: Re: How to know if data is piped into my script
Message-Id: <48059ef8$0$27937$426a74cc@news.free.fr>

Hi Makesh,


Small clarification.

  -p checks whether input is  a pipe
and "-p STDIN" would capture the case:

program | perlscript.pl


whereas -t CHECKS WHETHER input is a terminal.
so "unless -t STDIN" would also capture

perlscript.pl < filename


bye

N


Mahesh Asolkar wrote:
> On Apr 15, 12:49 pm, Frank Seitz <devnull4...@web.de> wrote:
>> Mahesh Asolkar wrote:
>>
>>> It should use  '`$ENV{'SHELL'} -c history`'. However if it is called
>>> like:
>>>   % history | myscript.pl
>>> It should use the piped in data instead.
>> unless (-t) {
>>     # STDIN is not opend to a tty but a file or pipe
>>
>> }
>>
> 
> Thanks Frank and Xho. -t and -p do exactly what I was looking for.
> 
> Xho, I had tried the first way you suggested too. It works in the case
> of 'history | myscript.pl', but it blocks 'myscript.pl' waiting for <>
> to return.
> 
> Here's the script with the changes (I picked -p):
> 
> ---------
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> my %hist = ();
> my @hist;
> 
> $hist{(split /\s+/)[3]}++
>   foreach ((-p STDIN) ? <STDIN> : `$ENV{'SHELL'} -c history`);
> 
> print map {"$hist{$_} : $_\n"}
>         sort {$hist{$b} <=> $hist{$a}}
>           keys %hist;
> ---------
> 
> /Mahesh


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

Date: Sun, 20 Apr 2008 08:42:03 +0800
From: "Ela" <ela@yantai.org>
Subject: how to parse from the end?
Message-Id: <fue3d1$sat$1@ijustice.itsc.cuhk.edu.hk>

The following rule sets are generated by a program, which is not readily 
human-readible. In order to formulate the rules into a table-like format 
(supposed I know all attributes in advance), e.g.

          code of (CA)n allele1   code of (CA)n allele2  LTC4Si_24 
CTLA41i_22  APOB1c_29     IL61i_16   PAI12c_54  ...     outcome      support
Rule1              <=2                            <=1 
1 or 3              1                    1 or 3 
0           29; 0.621
Rule2              <=2                            <=1 
1 or 3              1                    2 
1           5; 1.0
 ....
Rulen              <=2                              >1 
1/3               1/3                       0           52; 0.692
 ...

I plan to use [] as delimiter, as every line contains that, then back parse 
the values (e.g. 2,1, 3, MISSING) ,operators (<=, =, >, IS) and rule enders 
(=>). Finally count the number of '\t' from the beginning to know the level 
of rules. Why I think parsing from the end is because 'space' is more 
difficult to be used as a delimiter here.


code of (CA)n allele1 <= 2 [ Mode: 0 ] (241)
 code of (CA)n allele2 <= 1 [ Mode: 0 ] (61)
   LTC4Si_24 = 1 or  LTC4Si_24 = 3 [ Mode: 0 ] (44)
   CTLA41i_22 = 1 [ Mode: 0 ] (34)
    APOB1c_29 = 1 or APOB1c_29 = 3 [ Mode: 0 ] => 0 (29; 0.621)
    APOB1c_29 = 2 [ Mode: 1 ] => 1 (5; 1.0)
   CTLA41i_22 = 2 [ Mode: 0 ] => 0 (10; 1.0)
   LTC4Si_24 = 2 [ Mode: 1 ] => 1 (17; 0.765)
 code of (CA)n allele2 > 1 [ Mode: 0 ] (180)
  IL61i_16 = 1 or IL61i_16 = 3 [ Mode: 0 ] (107)
   PAI12c_54 = 1 or PAI12c_54 = 3 [ Mode: 0 ] => 0 (52; 0.692)
   PAI12c_54 = 2 [ Mode: 0 ] (55)
    LDLRc_46 = 1 or LDLRc_46 = 2 or LDLRc_46 IS MISSING [ Mode: 0 ] => 0 
(48; 0.958)
    LDLRc_46 = 3 [ Mode: 0 ] => 0 (7; 0.571)
  IL61i_16 = 2 or IL61i_16 IS MISSING [ Mode: 0 ] (73)
   F72c_52 = 1 [ Mode: 0 ] => 0 (59; 0.525)
   F72c_52 = 2 or F72c_52 IS MISSING [ Mode: 0 ] => 0 (14; 0.929)
code of (CA)n allele1 IS MISSING [ Mode: 0 ] (128) 




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

Date: Thu, 17 Apr 2008 07:47:15 -0700 (PDT)
From: mmccaws2 <mmccaws@comcast.net>
Subject: How to print question
Message-Id: <77a33807-b21d-4cd4-818f-23d53a67bbd5@2g2000hsn.googlegroups.com>

I can't quite recall the printing term so please bear with me.   When
you want your user to know that something is happening the app often
will print to the screen saying something like "load ...".  I want to
create the same sort of script that produce a "." or similar symbol
for each fraction of second that goes by.  If I knew the 'key' words
I'd search for it.

thanks

Mike


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

Date: Thu, 17 Apr 2008 14:59:50 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to print question
Message-Id: <Xns9A836FDE91ABAasu1cornelledu@127.0.0.1>

mmccaws2 <mmccaws@comcast.net> wrote in
news:77a33807-b21d-4cd4-818f-23d53a67bbd5@
2g2000hsn.googlegroups.com:

> I can't quite recall the printing term so please bear with me.  
> When you want your user to know that something is happening the
> app often will print to the screen saying something like "load
> ...".  I want to create the same sort of script that produce a "."
> or similar symbol for each fraction of second that goes by.

Why? Does your user not have a watch or something?

>  If I knew the 'key' words I'd search for it.

I would be much more interested in knowing how much 'progress' is 
being made.

For example, I once wrote a script to generate 1536 png files after 
some data processing. It ran in about 20 minutes.

### pseudo code

{
   my $progress = 0;
   while ( $datasets->next ) {
      # process data set
      ++ $progress;
      print STDERR '.' unless $progress % 100;
   }
}

###

so that a dot was printed every time 100 data sets were completed. 

In this throaway script, I used STDERR because STDOUT actually had 
other important output going to it.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Thu, 17 Apr 2008 16:02:21 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How to print question
Message-Id: <tc5kd5-tbp.ln1@osiris.mauzo.dyndns.org>


Quoth mmccaws2 <mmccaws@comcast.net>:
> I can't quite recall the printing term so please bear with me.   When
> you want your user to know that something is happening the app often
> will print to the screen saying something like "load ...".  I want to
> create the same sort of script that produce a "." or similar symbol
> for each fraction of second that goes by.  If I knew the 'key' words
> I'd search for it.

print? Which part of the program are you having a problem with?
Something like

    use Time::HiRes qw/sleep/;

    $| = 1;

    print 'loading';

    for (1..100) {
        sleep 0.1;
        print '.';
    }

    print "\n";

works, but presumably you don't *just* want to mark the passage of time.

Ben



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

Date: Thu, 17 Apr 2008 08:21:01 -0700 (PDT)
From: mmccaws2 <mmccaws@comcast.net>
Subject: Re: How to print question
Message-Id: <c178d16d-0aa8-459e-9312-690788c5047b@c65g2000hsa.googlegroups.com>

On Apr 17, 8:02=A0am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth mmccaws2 <mmcc...@comcast.net>:
>
> > I can't quite recall the printing term so please bear with me. =A0 When
> > you want your user to know that something is happening the app often
> > will print to the screen saying something like "load ...". =A0I want to
> > create the same sort of script that produce a "." or similar symbol
> > for each fraction of second that goes by. =A0If I knew the 'key' words
> > I'd search for it.
>
> print? Which part of the program are you having a problem with?
> Something like
>
> =A0 =A0 use Time::HiRes qw/sleep/;
>
> =A0 =A0 $| =3D 1;
>
> =A0 =A0 print 'loading';
>
> =A0 =A0 for (1..100) {
> =A0 =A0 =A0 =A0 sleep 0.1;
> =A0 =A0 =A0 =A0 print '.';
> =A0 =A0 }
>
> =A0 =A0 print "\n";
>
> works, but presumably you don't *just* want to mark the passage of time.
>
> Ben

Your code is almost exactly what I had.  But what is the "$| =3D 1;"
for?

Mike


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

Date: Thu, 17 Apr 2008 15:34:47 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: How to print question
Message-Id: <qfre04d0ouc1jsmo9vq03mecd1t09pm642@4ax.com>

mmccaws2 <mmccaws@comcast.net> wrote:
>Your code is almost exactly what I had.  But what is the "$| = 1;"
>for?

See "perldoc perlvar"

jue


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

Date: Thu, 17 Apr 2008 15:35:08 +0000 (UTC)
From: steveo@panix.com (Steven M. O'Neill)
Subject: Re: How to print question
Message-Id: <fu7qnc$833$1@reader2.panix.com>

mmccaws2  <mmccaws@comcast.net> wrote:
>Your code is almost exactly what I had.  But what is the "$| = 1;"
>for?

    perldoc perlvar | grep '$|'

-- 
Steven O'Neill                                  steveo@panix.com
Brooklyn, NY                        http://www.panix.com/~steveo


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

Date: Thu, 17 Apr 2008 09:19:35 -0700 (PDT)
From: mmccaws2 <mmccaws@comcast.net>
Subject: Re: How to print question
Message-Id: <815353c3-8f2c-4cdc-a125-ce88394c3737@m71g2000hse.googlegroups.com>

On Apr 17, 8:35=A0am, ste...@panix.com (Steven M. O'Neill) wrote:
> mmccaws2 =A0<mmcc...@comcast.net> wrote:
> >Your code is almost exactly what I had. =A0But what is the "$| =3D 1;"
> >for?
>
> =A0 =A0 perldoc perlvar | grep '$|'
>
> --
> Steven O'Neill =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0ste...@panix.com
> Brooklyn, NY =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0http://www.pan=
ix.com/~steveo

Thanks everyone  The missing link was the $| =3D 1;

Mike


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

Date: Sat, 19 Apr 2008 23:42:25 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: How to print question
Message-Id: <N9mdneJyV49NeJfVnZ2dnUVZ_r-vnZ2d@comcast.com>

mmccaws2 wrote:
> produce a "." or similar symbol for each fraction of second that goes by.

I had something like that, then decided to show progress once a second
(instead of per 100 or per 1000 items).
	-Joe

my($progress_time,$count);
sub wanted {
   $directories{$File::Find::name} = 1 if -d $_;
   return unless -f _;           # Skip symlinks and such
   push @files,$File::Find::name;
   ++$count;
   if ($verbose) {               # Once a second, output number of files found
     my $now = time;
     $progress_time ||= $now;
     print " $count" if $now > $progress_time;
     $progress_time = $now;
   }
}


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

Date: Sat, 19 Apr 2008 12:27:47 -0700 (PDT)
From: stpra123@gmail.com
Subject: How to record .asx files
Message-Id: <dcf0cf89-7d49-4bc3-870f-447685cfafde@w5g2000prd.googlegroups.com>

I was hoping to find some help on this issue. I am trying to take
an .asx file and convert it to .mp3. The problem is is that I need to
use the information encoded in the .asx file to determine when to
start recording and when to end recording (otherwise, I would just
take an off the shelf program to convert the files). For example, many
of the audio files don't start having sound until about 15 minutes
into the file so obviously I don't want to record the file until the
audio actually starts. An example is from: http://biz.yahoo.com/cc/. I
would need to do a batch conversion of multiple files. How would I do
this in PERL?


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

Date: Fri, 18 Apr 2008 18:33:29 +0200
From: "M.O.B. i L." <mikaelb@df.lth.se>
Subject: HTTP::Recorder and WWW::Mechanize for testing web sites
Message-Id: <fuaioh$qb8$1@news.lth.se>

Hi,
WWW::Mechanize is a Perl module that simulates a web browser.
You can use HTTP::Recorder to write WWW::Mechanize code automatically as
you surf, see the article:
http://www.perl.com/pub/a/2004/06/04/recorder.html

Then you can improve this code with variables and loops and use it for
testing of web sites.

I saved the proxy server program in the article and started it:
 ./proxy.pl &

I reconfigured Firefox to use the proxy server in 
Preferences/Advanced/Network/Connection Settings. It's on port 8080 on 
localhost, and use this for all protocols. Remember to remove localhost 
and 127.0.0.1 from 'No Proxy for' if you test against a local web server.

Then I test my web application using a newly reseted test database.

After that I stop the proxy:
kill -15 %1

And reset the database.

I then edit the file with output from the proxy script and add at top:
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
# use Test::More qw(no_plan);
my $agent = WWW::Mechanize->new();
$agent->cookie_jar(HTTP::Cookies->new);

I run this program. This should run without errors.

I can also check my web application and see that it is in the state it 
should be.

Now I have a test script that I can use after major changes to the web 
application to test that everything is still working.

Hidden form fields are considered read-only by HTTP::Recorder and 
WWW::Mechanize. I sometimes change them from JavaScript. I solved this 
by making them type="text" and setting the style="display:none".

There is a bug in 0.05 of HTTP::Recorder that bothered me but it can be
fixed, see:
http://cpanratings.perl.org/dist/HTTP-Recorder


Regards,
// Mikael


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

Date: Mon, 21 Apr 2008 22:40:41 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: I'd like a macro-processor as in classic book "software-tools".  Re: What's better than Template Toolkit?
Message-Id: <fuj558$m3p$1@reader2.panix.com>

Man, would it be nice to have available a macro processor
basically like the one developed in the classic Kernighan
book "Software Tools" (the red, ie fortran, one).

Way back in the 70's, well before Unix (TM) was allowed
outside of AT&T Bell Labs, Kernighan came up with a
very unix-like shell, grep, cat, comm, you name it,
and it got a big following, one branch out of
Lawrence Berkeley Labs (vax) and the other
out of U. of Arizona (Dec 10 & 20), and with
lots of improvements (over the book version) for
a lot of the tools.

(All the tools were written in "Ratfor", a very-C-like language
that was "compiled" into Fortran.)

I paid someone to greatly enhance the macro-processor, but
somehow after Sun came out with "real" unix (bsd+), that
stuff ***stupidly*** lost (by me and by others).

It was far better than the current m4.



Anyway, a simple macro language, where args are passed
by *position* in an arg list (as in normal languages),
very concise, very nice.


Anyone know of such a thing these days?


Thanks,

David




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

Date: Tue, 15 Apr 2008 22:55:25 -0700 (PDT)
From: Travis <travis.bowers@gmail.com>
Subject: Ignore empty lines and ones that start w/...
Message-Id: <2fd148b8-09dd-420f-b57f-928472a2804e@t12g2000prg.googlegroups.com>

While reading a file, ignoring empty lines seems pretty
straightforward, but how can I ignore a line that starts with
something like <-- which I use for comments.

ex:

<-- Title -->
<-- Date -->
 ...
info to parse
 ...



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

Date: Wed, 16 Apr 2008 06:10:53 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <87wsmymis2.fsf@hacking.dk>

Travis <travis.bowers@gmail.com> writes:

> While reading a file, ignoring empty lines seems pretty
> straightforward, but how can I ignore a line that starts with
> something like <-- which I use for comments.

The standard way of ignoring some lines while processing a file would
be something like:

    while(<>) {
        next if <some condition>;

        # process line
    }

So you'll just have to come up with a condition matching the lines you
want to ignore. I would probably just use aa regular expression.

//Makholm


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

Date: Wed, 16 Apr 2008 01:48:11 -0700 (PDT)
From: askingagain <atul.khot@gmail.com>
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <71c493b3-12e3-477d-a3ad-6d2d9c1515bb@q1g2000prf.googlegroups.com>

On Apr 16, 10:55=A0am, Travis <travis.bow...@gmail.com> wrote:
> While reading a file, ignoring empty lines seems pretty
> straightforward, but how can I ignore a line that starts with
> something like <-- which I use for comments.

What about
 perl -lne 'print unless /^\s*($|<--.*-->)/'

- HTH atul


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

Date: Wed, 16 Apr 2008 08:39:56 -0700 (PDT)
From: Travis <travis.bowers@gmail.com>
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <cbab4e57-c150-4cd8-b74f-e1956325b9d2@1g2000prg.googlegroups.com>

On Apr 16, 1:48 am, askingagain <atul.k...@gmail.com> wrote:
> On Apr 16, 10:55 am, Travis <travis.bow...@gmail.com> wrote:
>
> > While reading a file, ignoring empty lines seems pretty
> > straightforward, but how can I ignore a line that starts with
> > something like <-- which I use for comments.
>
> What about
>  perl -lne 'print unless /^\s*($|<--.*-->)/'
>
> - HTH atul

Actually I changed up my csv files to make it easier. Now i just want
to next if the line is blank or starts w/ a # for a comment.

I'm understand the next usage I'm just trying to understand the
expressions like /^s*...


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

Date: 16 Apr 2008 17:57:00 GMT
From: jt@toerring.de (Jens Thoms Toerring)
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <66msvcF2l491nU1@mid.uni-berlin.de>

Travis <travis.bowers@gmail.com> wrote:
> On Apr 16, 1:48 am, askingagain <atul.k...@gmail.com> wrote:
> > On Apr 16, 10:55 am, Travis <travis.bow...@gmail.com> wrote:
> >
> > > While reading a file, ignoring empty lines seems pretty
> > > straightforward, but how can I ignore a line that starts with
> > > something like <-- which I use for comments.
> >
> > What about
> >  perl -lne 'print unless /^\s*($|<--.*-->)/'
> >
> > - HTH atul

> Actually I changed up my csv files to make it easier. Now i just want
> to next if the line is blank or starts w/ a # for a comment.

> I'm understand the next usage I'm just trying to understand the
> expressions like /^s*...

That's a regular expression, applied to  to the line you just
read for matching. If you don't know about regular expressions
you better should get you a good book about Perl (or e.g.
"Mastering Regular Expressions" by Friedl, which covers the
use of regular expressions not only in Perl but also in several
other languages and gives some theoretical background) - they're
much too wide a topic to be covered by some news posting, but
are one of the big strenghts of Perl and you will find them in
nearly every Perl program you will look at.

But to give you an idea here's what you would need if you want to
skip blank lines or lines that have a '#' at the start (or after
one or more white-space characters, i.e. spaces, tabs etc.):

while ( <$f> ) {
    next if /^\s*($|#)/;
    do_something_with_the_line( $_ );
}

The stuff in between the slashes is the regular expression,
applied to try to match the default argument '$_', which in
this case is the line you just read in from the file.

The '^' at the start says that the comparison is to start at
the very beginning of the line. The '\s*' matches an unspe-
cified number of white-space charecters (between 0 and as
many as there are). The '$|#' means: either the end of the
line ('$') or a '#' character, with the '|' being the or
operator. Thus the whole line can be read as: next if the
line just read starts with zero or more white-space charac-
ters, followed by the end of the line or a '#' character.

The paranthesis around the '$|#' are necessary because

/^\s*$|#/

would mean: match if the line either just comtains zero or more
white space characters (i.e. it's a blank line) or if there's a
'#' to be found anywhere within the line.

                             Regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de


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

Date: Wed, 16 Apr 2008 21:10:05 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <Xns9A82AEA28A5F0asu1cornelledu@127.0.0.1>

jt@toerring.de (Jens Thoms Toerring) wrote in
news:66msvcF2l491nU1@mid.uni-berlin.de: 

> while ( <$f> ) {
>     next if /^\s*($|#)/;

next if /^\s*(?:$|#)/;

There is no need to capture anything.

>     do_something_with_the_line( $_ );

I also prefer to use lexical variables if I need to pass anything 
further to another routine (just to avoid any possible action-at-a-
distance effects).

while ( my $line = <$f> ) {
   next if $line =~ /^\s+$/;
   next if $line =~ /^\s*(?:$|#)/;

   do_something( $line );
}

<great explanation snipped for brevity>

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Thu, 17 Apr 2008 12:50:05 +0200
From: Hartmut Camphausen <JustMe@somewhere.de>
Subject: Re: Ignore empty lines and ones that start w/...
Message-Id: <MPG.227149ae9eba5095989680@news.t-online.de>

In <<cbab4e57-c150-4cd8-b74f-e1956325b9d2@1g2000prg.googlegroups.com>> 
schrieb Travis...

> I'm understand the next usage I'm just trying to understand the
> expressions like /^s*...

For quick/in-depth reference on regular expressions have a look at these 
documents provided with your Perl distribution:

	perldoc   perlrequick
	perldoc   perlretut
	perldoc   perlreref

where 'perldoc' is the command you type at the command prompt, 
'perlre...' is the document to be displayed.


hth, Hartmut

-- 
  ------------------------------------------------
Hartmut Camphausen      h.camp[bei]textix[punkt]de


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

Date: Fri, 18 Apr 2008 13:37:35 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Looking for a utility that lists all the functions under a  preprocessing directive in a C++ file .
Message-Id: <gddnd5x6qo.ln2@goaway.wombat.san-francisco.ca.us>

On 2008-04-18, Avi <avner-moshkovitz@shaw.ca> wrote:
> I'm looking for a utility that will scan a C++ file and list all the
> functions under a preprocessing directive.

Great!  I assume you've started writing your own code, since this
newsgroup isn't your paid consultant.  So post what you've written so
far, and people may help you fix it.

--keith



-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: Fri, 18 Apr 2008 13:24:25 -0700 (PDT)
From: Avi <avner-moshkovitz@shaw.ca>
Subject: Looking for a utility that lists all the functions under a  preprocessing directive in a C++ file .
Message-Id: <1f8f4bcc-0565-4284-ad46-742a2ed6e0ea@y18g2000pre.googlegroups.com>

I'm looking for a utility that will scan a C++ file and list all the
functions under a preprocessing directive.

In the example code below:
Upon request to list all the files under the preprocessing directive
AAA
the utiltiy should report
foo1
foo2

Upon request to list all the files under the preprocessing directive
BBB
the utiltiy should report
foo3

Thanks,
Avi

main()
{
}

#ifdef AAA

foo1()
{
}

foo2()
{
}

#endif

#ifdef BBB

foo3()
{
}

#endif

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





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

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

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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.

#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 V11 Issue 1457
***************************************


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