#perl
03 November 2007
Total 20 pages. You are browsing page 2/20.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
00:41 <****> "Be aware that assignment to state variables (as in state $x = 42) are executed every time; to initialize (or re-initialize) an undefined state scalar, you can use, for example, the defined-or assignment" -- perlsub 5.9.5
00:41 <****> I want to find a way to parse a c++ header file and alter/add to it
00:41 <****> perl sounds like a good language to do this in
00:41 <****> shaldannon: it's very useful!
00:41 <****> and I'm willing to bet there is something in perl to parse c++ header files
00:41 <****> tenshihan: search.cpan.org
00:41 <****> shaldannon: unless you're a fan of globals, in which case you probably wouldn't see the point :)
00:41 * CPAN upload: Test-Lazy-0.050_2 by RKRIMEN
00:41 <****> tenshihan: me too! give me 5 to 1 odds and I'll lay $10 on it
00:41 <****> iank: I hate globals
00:42 <****> hobbs: so what how would you do?
00:42 <****> s/what//
00:42 <****> ludan: ...
00:42 <****> ah ok
00:42 <****> :D
00:43 <****> //
00:43 <****> it seems to me that they could have somehow magically BEGINified the assignment though
00:43 <****> so as to make it not completely worthless
00:43 <****> whats the otehr one other than cpan?
00:44 <****> sub func { state $how_many_times //= 0; return ++$how_many_times; }
00:45 <****> but again, those slides are misleading :)
00:45 <****> ludan: which works as long as you don't want a significant undef in your state var ;)
00:45 <****> hobbs: yep
00:46 <****> ?
00:46 <****> I know ||=
00:46 <****> /// is defined-or
00:46 <****> er, //
00:46 <****> ah
00:46 <****> like $a = defined $a ? $a : $default;
00:46 <****> seee
00:46 <****> o_O
00:46 <****> sorry
00:46 <****> I get it
00:46 <****> did "they" finally put that in perl?
00:47 <****> yep
00:47 <****> cool
00:47 <****> Chris62vw: 5.9/5.10
00:47 <****> oh, cool
00:47 <****> the switch statment is cool as well
00:52 <****> oh...perl never had a conditional operator before?
00:53 <****> it didn't?
00:53 <****> uh?
00:53 <****> yes it did
00:53 <****> they add a new version of
00:53 <****> not a case one, but it's not really necessary
00:53 <****> given + when
00:53 <****> it never had a switch before
00:53 <****> (though it does make if/elsif/elsif more sane)
00:54 <****> no...i meant like the $a = defined $a ? $a : $default ;
00:54 <****> dlynes_laptop: it always had that
00:54 <****> the = ... ? ... : ... is called a conditional operator in C
00:54 <****> he had it but now you can do it easily with //
00:54 <****> ah
00:55 <****> I'd probably find the ?: easier because i"m already used to it in C, C++ and Java
00:55 <****> Does anyone here know a way to package a small perl script into a .deb?
00:55 <****> perlbot shorten it
00:55 <****> Shortened URL: http://xrl.us/8cc7
00:55 <****> cheatr: does it have a Makefile.PL already?
00:55 <****> matter of fact, you can nest conditionals for fun and annoyance :)
00:55 <****> (or some other method of "installing" it?)
00:56 <****> dondelelcaro: No it doesn't. Is there a tool to generate one? Or do I need to do it by hand?
00:56 <****> cheatr: you can do it by hand quick enough
00:56 <****> ?: is called the ternary operator in C, too
00:57 <****> hobbs: it seems to me that ~~ (the smart match) is not supported yet in 5.9.5, is it?
00:57 <****> dondelelcaro: By any chance do you know where a basic template is? I just have one .pl file. No modules are used. I want it to be put in /usr/bin
00:58 <****> niet groed
00:58 <****> cheatr: you could also look at stow
00:59 <****> ludan: sure it is
00:59 <****> perl5.10 has "say"? WHY?
00:59 <****> Chris62vw: why not? :)
00:59 <****> more junk
01:00 <****> Chris62vw: because they are enamoured with perl 6
01:00 <****> shaldannon: what exactly is stow? I've never heard of it before
01:00 <****> rmah, exactly. unfortunately
01:00 <****> cheatr: ExtUtils::MakeMaker::Tutorial has some good ones; you basically just need EXE_FILES for the singleton
01:00 <****> cheatr: I think that's Madalyn's last name
01:00 <****> cheatr: stow is a program for deb that lets you install modules into a system location
01:00 <****> cheatr: then once you have that, you can just dh-make-perl --build; in the directory, and it'll build and create a deb package for you
01:01 <****> don't use stow
01:01 <****> hah, there's a switch statement too... I wonder how Mr. Wall feels about these changes
01:01 <****> stow is really for systems with really bad package management, which isn't the case in Debian
01:01 <****> he approved them for p6 so he must like them
01:01 <****> Chris62vw: pretty happy, I would think...
01:01 <****> yeah
01:01 <****> I thought he purposely didn't add switch to earlier versions of perl
01:01 <****> p6 is gonna flop. too damn complex.
01:02 <****> I see all these really cool features and think "wow!"
01:02 <****> (if you're terminally lazy, you can do the stow equivalent using dpkg-deb with a DEBIAN/control file or similar)
01:02 <****> but then I step back and think of most of the guys I've known who hack perl
01:02 <****> and I weep
01:03 <****> rmah: well theoretically the idea is that you should be able to ignore 99% of the language if you like
01:03 <****> rmah: but I agree, there's too much of it.
01:03 <****> hobbs: how can you do that when someone else didn't?
01:03 <****> dondelecaro: I haven't read the link yet, but you do know that I'm running Ubuntu, not windows
01:03 <****> windows?
01:04 <****> shaldannon: the only problem is that it isn't a module, it's a a single pl file
01:04 * dondelelcaro hasn't said anything about the spawn of redmond
01:04 <****> Are there any well-known programs that are portable and written in Perl?
01:04 <****> cheatr: well honestly the best thing to do there is to turn it into a module, plus a bundled script that does nothing but options processing and a call into the module.
01:05 <****> dondelelcaro: I thought the exe_files was refering to windows (I didn't read the lnik yet)
Total 20 pages. You are browsing page 2/20.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
