I’m starting to hate Perl

I’ve just wasted half an hour on a simple Perl script because of some stupid errors that is all to do with Perl’s quirkiness (in my opinion). This is one of the reasons why I am beginning to develop a certain level of hatred for it. Tell me what is wrong with this….
 
sub check_subnet_prof {
   my $subnet_addr = @_;
   my ($sip1,$sip2,$sip3,$sip4) = split(/./,$subnet_addr);
[snip]
 
It looks fine to me but after a load of frigging around it appears that you have to do this (in red)…
 
sub check_subnet_prof {
   my ($subnet_addr) = @_;
   my ($sip1,$sip2,$sip3,$sip4) = split(/\./,$subnet_addr);
[snip]
 
I mean for God’s sake, I can understand having to escape the period in the split function (as it’s a string concatenator, although it’s not obvious) but you can use "my" with or without brackets so why does it have to be so fussy?
 
It’s a good job I don’t have any hair as I’d have pulled it all out by now! Wink
Advertisements
This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s