[19576] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1771 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 19 06:05:46 2001

Date: Wed, 19 Sep 2001 03: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)
Message-Id: <1000893907-v10-i1771@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 19 Sep 2001     Volume: 10 Number: 1771

Today's topics:
        call c from Perl (fly98us)
    Re: call c from Perl <bart.lateur@skynet.be>
    Re: call c from Perl (Martien Verbruggen)
    Re: convert time string to date format <Thomas@Baetzler.de>
        Error 405 using  application/x-www-form-urlencoded (Todd Canedy)
    Re: example for rewinddir (Anno Siegel)
    Re: example for rewinddir (Joachim Ziegler)
    Re: example for rewinddir (Anno Siegel)
        filter out short strings <sun_tong@users.sourceforge.net>
    Re: filter out short strings <wyzelli@yahoo.com>
    Re: filter out short strings <rob_13@excite.com>
    Re: filter out short strings (Damian James)
        Global variables <philippe.perrin@sxb.bsf.alcatel.fr>
        Help - https authentication <herve.schlecht@wanadoo.fr>
        How to htmlize an email, for eg lynx? (David Combs)
        How to write in Excel-Files?? <christian.wanninger@toshiba-tro.de>
    Re: How to write in Excel-Files?? <bart.lateur@skynet.be>
    Re: html 2 xml <tintin@snowy.calculus>
        Net::FTP and AIX <bdensmore@austin.rr.com>
        pattern matching and multilines (sort of) (Øyvind Gjerstad)
        Problems with SNMP <nospam-widget01@hotmail.com>
    Re: split SuchKindOfWord into individual words (Anno Siegel)
    Re: Using the c preprocessor for non c purposes <david.thompson1@worldnet.att.net>
    Re: What does this do ? "select( (select($writer), $|=1 (Anno Siegel)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 19 Sep 2001 01:30:05 -0700
From: fly98us@yahoo.com (fly98us)
Subject: call c from Perl
Message-Id: <6810d383.0109190030.86b1417@posting.google.com>

Hi,
  Is there any method to call c functions directly from Perl?
  BR / Lishan
  2001.09.19


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

Date: Wed, 19 Sep 2001 09:34:20 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: call c from Perl
Message-Id: <g0pgqts89qfgqrghi32anel9tt9ac8n04i@4ax.com>

fly98us wrote:

>  Is there any method to call c functions directly from Perl?

No.

Huh, actually there is. There are. There's the old style XS mechanism
for creating modules. There's SWIG, IIRC. But most popular currently
seems to be the module Inline. You do need a C compiler, though.

	<http://search.cpan.org/search?dist=Inline>

See also:

<http://www.perl.com/pub/a/2001/02/inline.html>

<http://www.swig.org>

In the FAQ:
perlfaq3
  Where can I learn about linking C with Perl? [h2xs, xsubpp]

-- 
	Bart.


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

Date: Wed, 19 Sep 2001 19:50:13 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: call c from Perl
Message-Id: <slrn9qgqil.sv.mgjv@martien.heliotrope.home>

On 19 Sep 2001 01:30:05 -0700,
	fly98us <fly98us@yahoo.com> wrote:
> Hi,
>   Is there any method to call c functions directly from Perl?

That depends on how directly you want it. If you mean that you have a C
library, and you want to directly call the functions in that library,
no. If you want system calls, have a look at syscall [0].

If you are prepared to do a little bit of work, wrappering the C
functions, then you should have a look at XS [1], or SWIG [2].
Alternatively, you can put C code directly in your Perl program
(excellent) with Inline::C [3].

Martien

[0] ... described in the perlfunc documentation.

[1] See the perlxs and perlxstut documentation. Also see the h2xs tool.

[2] See the SWIG web site at www.swig.org.

[3] Available from CPAN: www.cpan.org, search.cpan.org.
-- 
Martien Verbruggen              | 
Interactive Media Division      | 
Commercial Dynamics Pty. Ltd.   | Curiouser and curiouser, said Alice.
NSW, Australia                  | 


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

Date: Wed, 19 Sep 2001 10:20:31 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: convert time string to date format
Message-Id: <h4lgqtcsinskjq07ggigmqsl8jeue7m49t@4ax.com>

On Tue, 18 Sep 2001, Bart Lateur <bart.lateur@skynet.be> wrote:

>Thomas Bätzler wrote:
[...]
>>my %month = (
>>  'Jan' => 0, 'Feb' => 1, 'Mar' => 3,
>>  'Apr' => 0, 'May' => 1, 'Jun' => 3,
>>  'Jul' => 0, 'Aug' => 1, 'Sep' => 3,
>>  'Oct' => 0, 'Nov' => 1, 'Dec' => 11 );
[...]
>This prints:
>
>Mon Sep 17 16:49:46 2001 is 987518986 seconds after 0:00:00 on 1. 1.
>1970
>
>That value seems too low to me, since we recently passed the 1E9 mark.
>And it is:
>
>	print scalar localtime($ticks);
>-->
>	Tue Apr 17 16:49:46 2001
>
>Gee. 5 months low. I wonder why. Most probably because your %month hash
>has such weird values.

What can I say - the perfect diagnosis :-) I should've changed the
values, too, when I copied the first three lines. But that's what you
get when all of a sudden a virus panic breaks out...

Cheers,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: 18 Sep 2001 22:21:30 -0700
From: tcaxoxs@yahoo.com (Todd Canedy)
Subject: Error 405 using  application/x-www-form-urlencoded
Message-Id: <61782897.0109182121.72bede40@posting.google.com>

Using the code directly out of the perl documentation for LWP:
When using:
$req->content_type('application/x-www-form-urlencoded');
I get error 405.
The req is not going to my server, but to a remote server for payment
processing. I am working inside of Intershop 3 using perl 5.004 and
writng an extension for payment processing. Is anyone familiar with
this no-longer supported environment?

Do I have to setup this MIME type in my NT server and associate it to
 .pm?
Can someone explain the relationship between the NT mimemap in the NT
registry  and the MIME types setup in IIS4.0 ?
Does one require the other?

Any and all help including links to read will be greatly appreciated.
tia,
Todd


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

Date: 19 Sep 2001 08:59:18 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: example for rewinddir
Message-Id: <9o9mp6$hs1$1@mamenchi.zrz.TU-Berlin.DE>

According to Bart Lateur  <bart.lateur@skynet.be>:
> Anno Siegel wrote:
> 
> >According to Joachim Ziegler <ziegler@algorilla.de>:
> >> can someone give me a good example
> >> for a situation, in which "rewinddir" is useful?
> >> 
> >> i don't see any!
> >
> >You can't think of a situation where it would be useful to read
> >a directory twice?
> 
> I don't see a reason for stopping and restarting halfway through. If you
> want to read it twice, it's just as easy to opendir() again.

You might discover, halfway through, that for some exceptional reason
you have to start over.  You may also want to give a directory handle
(in pristine condition) to a sub after reading part of the directory.
It isn't hard to come up with examples, though I'll admit I can't
remember seeing any in practice.

If your are saying that there is nothing rewinddir() does that another
opendir() doesn't, I'll have to agree.  But I don't think that was
the point.
 
> (Unfortunately, and opposed to close() for a file, there is no implicit
> closedir().)

Implicit under what conditions?  Experimentally, I find that when a
directory handle goes out of scope, the directory is closed.  "fuser"
says so.

Anno


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

Date: 19 Sep 2001 02:13:36 -0700
From: ziegler@algorilla.de (Joachim Ziegler)
Subject: Re: example for rewinddir
Message-Id: <93aad7d0.0109190113.6cf223a3@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<9o75b3$cjj$1@mamenchi.zrz.TU-Berlin.DE>...
> According to Joachim Ziegler <ziegler@algorilla.de>:
> > can someone give me a good example
> > for a situation, in which "rewinddir" is useful?
> > 
> > i don't see any!
> 
> You can't think of a situation where it would be useful to read
> a directory twice?
> 
> Anno

no, because

1) if i knew, i would not pollute this newsgroup with unnecessary
questions
2) you can save all file names in an array while reading a directory
3) you can closedir() a directory, then opendir() it again and read
again
4) if you make changes to a directoy (removing/adding a file), you can
remember this by changing the corresponding array

so, i don't see any examplary situation for a meaningful use of
rewinddir (or, what's worse, seekdir() and telldir() ).

i'm not a system programmer, so maybe some can give me a hint.


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

Date: 19 Sep 2001 09:49:35 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: example for rewinddir
Message-Id: <9o9pnf$kf9$1@mamenchi.zrz.TU-Berlin.DE>

According to Joachim Ziegler <ziegler@algorilla.de>:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message
> news:<9o75b3$cjj$1@mamenchi.zrz.TU-Berlin.DE>...
> > According to Joachim Ziegler <ziegler@algorilla.de>:
> > > can someone give me a good example
> > > for a situation, in which "rewinddir" is useful?
> > > 
> > > i don't see any!
> > 
> > You can't think of a situation where it would be useful to read
> > a directory twice?
> > 
> > Anno
> 
> no, because
> 
> 1) if i knew, i would not pollute this newsgroup with unnecessary
> questions

Heyhey...  Just making sure what you are aiming at.

> 2) you can save all file names in an array while reading a directory

Probably true for standard file systems and one or a few directories.
If a directory (on a non-standard file system) has millions of entries,
or if you have to deal with a thousand directories at once, that may
change.

> 3) you can closedir() a directory, then opendir() it again and read
> again

Sure.  rewinddir() is a (probably more efficient) shortcut for a
second opendir().  That's why I asked what you mean.

> 4) if you make changes to a directoy (removing/adding a file), you can
> remember this by changing the corresponding array

Well, yes... you could.

> so, i don't see any examplary situation for a meaningful use of
> rewinddir (or, what's worse, seekdir() and telldir() ).
> 
> i'm not a system programmer, so maybe some can give me a hint.

Well, rewinddir() is certainly not indispensable, but neither are tell()
and seek() for ordinary files.  For the reasons you name, rewinddir
is probably not used very often.

Anno


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

Date: 19 Sep 2001 01:58:03 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: filter out short strings
Message-Id: <sa8elp36alg.fsf@suntong.personal.users.sourceforge.net>

Hi,

How can I filter out strings that are too short from an array?

@out = grep { (=~ tr/a-z//i) <3} @in;

Bareword found where operator expected, near "tr/a-z//i"

-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


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

Date: Wed, 19 Sep 2001 14:43:13 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: filter out short strings
Message-Id: <VIVp7.55$Kv2.695@wa.nnrp.telstra.net>

"* Tong *" <sun_tong@users.sourceforge.net> wrote in message
news:sa8elp36alg.fsf@suntong.personal.users.sourceforge.net...
> Hi,
>
> How can I filter out strings that are too short from an array?
>
> @out = grep { (=~ tr/a-z//i) <3} @in;
>
> Bareword found where operator expected, near "tr/a-z//i"
>

@out = grep {(length $_ > 3)} @in;


Wyzelli

--
@x='074117115116032097110111116104101114032080101114108032104097099107101114
'=~/(...)/g;
print chr for @x;





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

Date: Wed, 19 Sep 2001 05:08:23 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: filter out short strings
Message-Id: <Xns9121B89DA4CBrock13com@64.8.1.227>

* Tong * 
<news:sa8elp36alg.fsf@suntong.personal.users.sourceforge.net>:

> How can I filter out strings that are too short from an array?
> 
> @out = grep { (=~ tr/a-z//i) <3} @in;
> 
> Bareword found where operator expected, near "tr/a-z//i"
> 

Perhaps,

@out = grep( length >= 3, @in);

-- 
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: 19 Sep 2001 05:11:17 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: filter out short strings
Message-Id: <slrn9qga3g.r7f.damian@puma.qimr.edu.au>

On 19 Sep 2001 01:58:03 -0300, * Tong * said:
>
>How can I filter out strings that are too short from an array?
>
>@out = grep { (=~ tr/a-z//i) <3} @in;

@out = grep { length >= 3 } @in;

See perldoc -f length

Cheers,
Damian
-- 
@:=grep!(m!$/|#!..$|),split//,<DATA>;@;=0..$#:;while($:=@;){$;=rand
$:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,,
$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/}  __END__
Just another Perl Hacker,### http://home.pacific.net.au/~djames.hub


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

Date: Wed, 19 Sep 2001 10:09:05 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Global variables
Message-Id: <3BA852A1.A63B3858@sxb.bsf.alcatel.fr>

Hi

I have a script.pl file, where I use a global variable :
use strict;
my %hash;

In this .pl file, I use some .pm files of my own. How can I make these
 .pm modules access the %hash variable, defined in the .pl script ?

Thanx !

-- 
PhP

($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}


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

Date: Wed, 19 Sep 2001 07:51:37 +0200
From: "HS" <herve.schlecht@wanadoo.fr>
Subject: Help - https authentication
Message-Id: <9o9bjd$sd5$1@wanadoo.fr>

We use a Novell BorderManager Proxy for access to Internet.

Before I can go to Internet I need authenticate me through an https page.
Can somebody explain me how I can take this an what for module I need for
this.

Thanks for your help




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

Date: 19 Sep 2001 03:00:01 -0400
From: dkcombs@panix.com (David Combs)
Subject: How to htmlize an email, for eg lynx?
Message-Id: <9o9fph$m84$1@panix1.panix.com>

I get emails (from a listserv) that has
lots of interesting links.

Being as I do *not* use M$, and instead use
(as email-reader) mutt, I need some way to
convert an email like this:


Building Debate: Should Twin Towers Go Up Again?
http://www.dallasnews.com/national/472263_nycarchitect_1.html

We Cannot Allow Fear to Dictate Commercial Architecture
http://www.jsonline.com/news/metro/sep01/goulcol17091601a.asp
  
The End of Tall Buildings
http://www.planetizen.com/oped/item.php?id=30

Rebuild or Not: Architects Respond
http://www.nytimes.com/2001/09/23/magazine/23REBUILD.html




into an html doc that I can read via lynx and then
easily link to the various sites.

Now, there is a program, "urlview", that aids in this:
you map a mutt key to run that program on the current
email, and it runs lynx with the "page" being a simple
list of the urls themselves -- but with none of that
commentary *about* the link, eg the
"The end of Tall buildings"
above.

Writing a perl program to convert this to html should
be trivial -- any suggestions on how to do this in
a clever way?

Thanks!

David



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

Date: Wed, 19 Sep 2001 09:17:29 +0200
From: "Christian Wanninger" <christian.wanninger@toshiba-tro.de>
Subject: How to write in Excel-Files??
Message-Id: <9o9k6l$dqg$1@news1.dtag.de>

Hello!
Does anyone know how to open and write data in an existing Excel-File with
Spreadsheet::WriteExcel?? I only could create a new Excel-File and write
into this file!

Thanxx





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

Date: Wed, 19 Sep 2001 09:38:47 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to write in Excel-Files??
Message-Id: <elpgqtk4d0plmb52gh0ioc8snnch90i9n6@4ax.com>

Christian Wanninger wrote:

>Does anyone know how to open and write data in an existing Excel-File with
>Spreadsheet::WriteExcel?? I only could create a new Excel-File and write
>into this file!

Perhaps you should open it with SpreadSheet::ParseExcel, first? I don't
know how well these two modules integrate, though.

Ooh, I noticed that there is a DBD::Excel on CPAN, too. Still alpha...

It appears to be built around Spreadsheet::ParseExcel,
Spreadsheet::WriteExcel, and SQL::Statement. Surprise surprise.

-- 
	Bart.


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

Date: Wed, 19 Sep 2001 18:21:46 +1000
From: "Tintin" <tintin@snowy.calculus>
Subject: Re: html 2 xml
Message-Id: <zBYp7.20$EW4.51251@news.interact.net.au>


"Dave Palmer" <dave@nospam.stratumonline.com.del> wrote in message
news:gbLp7.29279$gU.8943222@news1.rdc1.md.home.com...
> Hello all...
> I am writing this script that reads an HTML file, and does some basic
> transformations so that it could be considered a well formatted XML
> document.
>
> Any example of what I'm talking about is... if you come across this line:
>
> <br>
>
> In XML, this is not well formatted... but <br/> is

Actually that's XHTML

[snipped code]

For some reason, there have been a lot of questions related to this topic
this week.  I'd echo Chris Fedde, and recommend you use html tidy.




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

Date: Wed, 19 Sep 2001 03:53:06 GMT
From: "Bob Densmore" <bdensmore@austin.rr.com>
Subject: Net::FTP and AIX
Message-Id: <CEUp7.281835$g_3.63507077@typhoon.austin.rr.com>

I asked the Unix admins at the shop to install the Net::FTP perl module.
They had never heard of CPAN and after looking around, basically said they
would not install the perl module because it had not been tested and
certified on AIX.

What do you say about this?

Bob D.





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

Date: 19 Sep 2001 11:22:07 +0200
From: ogj@itpc06.tollpost.no (Øyvind Gjerstad)
Subject: pattern matching and multilines (sort of)
Message-Id: <wr1yl31qo0.fsf@itpc06.tollpost.no>

I'm searching for a tool that lets me match lines with escaped 
newlines and treat them as one line.

Let's say I have a file that look like this:
abc \
  def \
  gih

Note this is a file with 3 lines, where two of the lines have an escaped 
newline.

I want to treat this as one line, i.e. when from the command line i 
grep for "def" i want to get the whole line. Preferrably as one line.
Like this:
abc   def   gih

I have made up something that works, but I just wonder if something like 
is possible with just mucking with $/. Or if there are better ways of 
doing this.

There are probably bugs here:

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

use strict;

my $pattern = shift or die "Usage: $0 <pattern> <file>...\n";
my $line;
while(<>) {
   if (s/\\\n$//) {
     $line .= $_;
     next;
   } else {
     $line .= $_;
     print $line if $line =~ m/$pattern/o;
   }
   $line="";
}


TIA,
-- 
Øyvind Gjerstad  Systems dept DFDS Tollpost-Globe AS  N-6301 Åndalsnes/Norway
E-mail: ogj@tollpost.no      Phone: +47 7122 6663       Fax: +47 7122 6694


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

Date: Wed, 19 Sep 2001 07:19:59 GMT
From: "d.r." <nospam-widget01@hotmail.com>
Subject: Problems with SNMP
Message-Id: <zGXp7.24422$jY.618274@news1.rdc1.bc.home.com>

Hi there, I've been running a small little script of mine for a while that
tracks network traffic and stores it.  Currently I have something that
works, but isn't very flexible (i'm using output from netstat).  Anyways,
I've decided to expand it a bit, and instead of just relying on output from
netstat, to start using the SNMP module(s) available for perl.
I have all the snmp(d) stuff setup on the system, and it runs fine, but i'm
having problems with some beginning steps of the module/perl script.
basically, it's as follows, i'm trying to do something very simple with the
SNMP::Util module, just to get started:

#!/usr/bin/perl
use lib "/usr/local/lib";
use SNMP::Util;
$snmp = new SNMP::Util(-device => 'localhost',
                -community => 'public',
                -timeout => 5,
                -retry => 0,
                -poll => 'on',
                -poll_timeout => 5,
                -verbose => 'off',
                -errmode => 'return',
                -delimiter => ' ',
                );
print "\ndone\n";

as you can see, all i'm trying to do is initialize a new SNMP::Util object.
(this code was pretty much copy/pasted directly out of the man page for
SNMP::Util)

and here is my problem, the output is as follows:
--------------------------------------------------------------------
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (SNMPv2-SMI): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)

done
--------------------------------------------------------------------
here is what i have installed:
perl 5.005_03
p5-SNMP
p5-SNMP-Util
p5-SNMP_Session

running on FreeBSD 4.3 Stable

Any help/guidance on the situation would be very greatly appreciated!
Also any links to pages with possible code/tutorials/code snippets involving
perl and snmp would be great (heck, even a book or two would be nice).

thanks in advance,
Derek R.




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

Date: 19 Sep 2001 09:59:58 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: split SuchKindOfWord into individual words
Message-Id: <9o9qau$kf9$2@mamenchi.zrz.TU-Berlin.DE>

According to Chris Fedde <cfedde@fedde.littleton.co.us>:
> In article <sa88zfc6y8f.fsf@suntong.personal.users.sourceforge.net>,
> * Tong *  <sun_tong@users.sourceforge.net> wrote:
> >Hi,
> >
> >I'm wondering if there are some neat ways to split SuchKindOfWord
> >into individual words, i.e., Such Kind Of Word. 
> >
> >Any tip will be appreciated. Thanks
> >
> 
> I'm sure that the golf pros can do better than this but here is my attempt:
> 
> perl -e 'print "$1 "while("SuchKindOfWord"=~/([A-Z][[a-z]+)/g);print"\n"'

           print "$1 "while("SuchKindOfWord"=~/([A-Z][a-z]+)/g);print"\n"

No golf pro ambitions, but one letter saved :)

Anno


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

Date: Wed, 19 Sep 2001 05:32:27 GMT
From: "David Thompson" <david.thompson1@worldnet.att.net>
Subject: Re: Using the c preprocessor for non c purposes
Message-Id: <L5Wp7.1283$W8.126451@bgtnsc04-news.ops.worldnet.att.net>

#if IMPLEMENTATION_SPECIFIC_ON_CLC
B. Caligari <bcaligari@fireforged.com> wrote :
> While just toying around, I was wondering if I can use the c preprocessor
> for just about anything.

For a lot of things that use lexemes compatible with C rules, yes.
People have even gotten it to work on "good" FORTRAN, although
IMNSHO it's quicker to just bash yourself in the head with a brick.

 ...
> gcc's -E let's me just run files through the C preprocessor.  How can I, if
> possible, retrieve the output of the preprocessed file?
>
Redirect stdout (on systems that support it) or use -o.
info gcc / Options Controlling Kind of Output

You may also want -P, and possibly -C if you use C comment syntax.
info gcc / Options Controlling the Preprocessor

--
- David.Thompson 1 now at worldnet.att.net







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

Date: 19 Sep 2001 09:13:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: What does this do ? "select( (select($writer), $|=1)[0] );" ?
Message-Id: <9o9niv$hs1$2@mamenchi.zrz.TU-Berlin.DE>

According to Joe Schaefer  <joe+usenet@sunstarsys.com>:

> -- 
> Joe Schaefer   "How many legs does a dog have if you call the tail a leg? Four.
>                          Calling a tail a leg doesn't make it a leg."
>                                                -- Abraham Lincoln

Ah, but how many tails does the dog have?

One dog has one more tail than no dog.
No dog has two tails.
--------------------------------------
One dog has three tails.

Anno


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

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.  

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 V10 Issue 1771
***************************************


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