Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
mdxi
Mar 13, 2006

to JERK OFF is to be close to GOD... only with SPURTING

TiMBuS posted:

Personally if this was a public module and Amazon made it, I wouldn't hold a grudge if it was released on CPAN under the name Amazon::ISBN. On the other hand I would also understand if they named it ISBN::Parser since it's general-purpose...
I guess what I'm trying to say is.. eh. It shouldn't really matter should it?

Exactly. While arguments could be made for module names (which is to say: CPAN hierarchies) being meanigful or not being meaningful, the truth is that they are not. There is no CPAN-police enforcing any sort of naming scheme or quality control standards (although the perl-qa project evaluates all modules uploaded to the CPAN for "kwalitee", which is a metric of how well-formed a module is according to current standards).

search.cpan.org is your friend (as are cpanratings and annocpan (both integrated into search.cpan)).

Adbot
ADBOT LOVES YOU

mdxi
Mar 13, 2006

to JERK OFF is to be close to GOD... only with SPURTING

CrazyPanda posted:

I have perl 5.10 downloaded and extracted on to my desktop. I have no idea how to use it. I downloaded activeperl before and i was able to "install it" and run basic script on my computer. Can anyone show me how to get started with perl 5.10? The book programming perl i got and a lot of the tutorials on line never touch up on this fact.

I can't say for sure, but I think what you might have there is a source tarball, since you seem to indicate that it's not ActivePerl. You might be interested in Strawberry Perl, which is created and maintained by one of the Perl community's most dedicated hackers.

This still won't tell you exactly how to get going though. Personally, I'd recommend a copy of the Llama book (Beginning Perl), and I'd recommend that you skip chapter 1. If you already have references on hand, just realize that Strawberry Perl (or a Perl you build yourself) is not an IDE, it's just a language interpreter, the core modules, and some helper tools like 'cpan', which will fetch new modules for you from the CPAN -- the expectation is that you're going to write scripts in the editor of your choice and run them.

Sorry if any of this is too basic or redundant; I have no idea about your skill level, and I'm not a Windows user, so I can only speak to the universalities of the language.

Finally, since you're asking about Perl 5.10, you might wanna check out this pretty sweet little piece of work: Perl 5.10 For People Who Aren't Totally Insane, a deep but generally followable introduction to the new bits in 5.10

mdxi
Mar 13, 2006

to JERK OFF is to be close to GOD... only with SPURTING

ashgromnies posted:

I find it much easier to install Cygwin with the perl runtimes and your editor of choice(vi is pretty nice for perl). Windows-native perl is kind of difficult to work with due to the lack of a strong command-line.

That's exactly the purpose of the Strawberry Perl distro; it obviates the need to install Cygwin, or anything else. It's a fully self-contained Perl for Windows :)

Hmmm. Rereading your comment, I realize that you might be talking about perl-as-system-glue and not simply perl-the-language, in which case I'm sure you would want Cygwin as well. But if you want Just Perl, you don't need to fiddle with Cygwin installs anymore. I just wanted to point out that Strawberry Perl can act as a standalone distro because there has been some confusion about that issue in the past week as people's interest has been piqued due to the 5.10 accouncements.

mdxi
Mar 13, 2006

to JERK OFF is to be close to GOD... only with SPURTING

Sometimes, because perl tries to be so flexible, I'll get a horrible idea and just see if it works.

I have a nested datastructure, and wanted to know if a list -- which would always exist and have at least one element -- would have more than one element in it. The "sane" expression that I settled on is:

code:
if (defined $res->{cat}{slist}[1])
But before that, I decided to try this, just to see if the parser would do the right thing:

code:
unless ($#{@{$res->{cat}{slist}}} == 0);
It does :aaa:

mdxi
Mar 13, 2006

to JERK OFF is to be close to GOD... only with SPURTING

Pweller posted:

I'm finding Perl syntax to be very strange.... and frustrating.

This is less about Perl's syntax and more about how non-shared-memory IPC works.

Backticks aren't "real" bi-di IPC at all. Like in the shell, backticks do not open a channel to the subordinate process. They simply launch the command, wait for it to exit, then store whatever output there was in the variable you specify.

Things like IPC::Run3 and IPC::Open2 create bidirectional channels, which is what you want, but they do still have pitfalls (especially IPC::Open2, which is a recipe for deadlock unless you have control over what BOTH sides are sending, and know that every filehandle is autoflushing). They're pretty simple to use, though.

Probably the safest and most flexible (but definitely the most complex) answer is using IO::Select and IO::Socket to do IPC via the networking stack instead of pipes.

  • Locked thread