Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Synopsis (On Perl and strings and arrays) 1

Status
Not open for further replies.
Madre De Dios,
This is the most ridiculous thing I've seen. I am new to Perl and while at the same time I enjoy all the stuff you can do this stuff is pretty damn cryptic. Working with strings in Perl is a real pain in the arse if you ask me. I see plenty of articles and books saying "oh Perl is so great with strings".....I'm not seein it. There are a few cool things you can do with strings in it that you couldn't in another language but the fun stops there. I feel kinda let down after all the hype I've read in these books about how easy strings are in Perl. Looks like I'll be porting my enormous string class over to Perl. My class I believe is more useful than anything else I've seen. It consists of over 100 routines and functions and is growing all the time. It's the child of over a year of work. Transferring this stuff to Perl looks like it's gonna take a while. Look out for it sometime in August. I'll make a post when I have it ported.
 
Well everybody has their own preferences for computer languages. I definitely prefer Perl for string manipulation because it is flexible and powerful. I bet that most of the capabilities in your "string class" are already built into Perl or are implemented in the modules on CPAN (
I agree that Perl's regular expressions can be cryptic, but the pain of learning the syntax is worth the power of Perl's regular expressions. You mentioned that it took over a year of work to create your "string class". Well I venture that it would take a lot less time to master Perl's regular expressions.
 
hey friend,
can you point me in the direction where I can find a good list of ALL the string manipulation stuff you can do in Perl. I have 3 books and a hell of a lot of websites I'm learning from and so far no good for me with strings, even though I've taken a look at a lot of the functions from each. I understand the syntax but I just don't like usin em, and there's not enough functionality for me personally ^_^. This is becoming my favorite language already but these strings will take more time than I can spare right now, So I'll stick to writing my modules in C++ to handle the string manipulation stuff ;-). It's cheating I know but I have deadlines to meet.
And we'll see whose string class is more powerful. When I port mine into Perl I would like you to test mine against Perl's. I am 100% confident that mine has more functionality of anything you've ever used ;-p, unless it's something you wrote.
Thanks for the links too, I'll take a look at em.
P.S. I just realized I said I took a year for this stuff...oops, I had 70 of the functions done in 3 weeks and the rest have been built here and there over past 7 or 8 months
 
you'll find gobs of string manipulators on specifically had a list of all the modules that fit into that category. there's also the book, The Perl Cookbook, which has a few tricks for dealing with strings.
as for your modules being better, that would be fantastic. take a look at the modules available from cpan(comprehensive perl archive network), and if you have functionality that isn't already out there, submit your ported modules to cpan and make them available to the whole perl community - we'll all love you for it. "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
 
Go Goku81,
Maybe give us a crack at a few. The folklore says that Perl can do what C can with strings better, faster, easier. We can see if the folklore is more than myth. If C++ is better, you will have lost no time. If Perl gives you any advantages, maybe you'll get some free support here.

Also, the modules that exist on CPAN exist because someone built something that they thought others might find useful. So, if you're that good, I'm sure the Perl community would love more toys...... However, I have yet to need more that Perl can do...

- regex's - extremely powerful! - cryptic but well worth the work of learning.
if ($str =~ /some pattern/) { do something; }
while ($str =~ /some pattern/) { do something; }
$str =~ s/pattern/replacement/gis;
$str =~ s/pattern/&subRoutine_here/gise;

Core Perl Functions:
splice
split
join
substr
uc
ucfirst
lc
lcfirst
chop
format
grep
index
rindex
hex
length
pack
unpack
printf
sprintf
etc........

HTH

PS - i wonder if Mary knows Perl....
<pondering ... the theological ramifications of such......Hhmmmm...>


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top