Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: what is @$varname in perl

by andal (Hermit)
on Jul 03, 2014 at 10:58 UTC ( [id://1092148]=note: print w/replies, xml ) Need Help??


in reply to Re^2: what is @$varname in perl
in thread what is @$varname in perl

Well, the above code makes sense. Maybe it is not very efficient because it splits lines inside of the sort, but it should work.

It looks like you don't know perl, so it is bad idea to write in perl when you don't know it. So either learn it, or ask someone to write the code that you need. For that, specify exactly what the code should do.

It's just hard to answer random questions about perl, when the listener does not know much about it. Without ground knowledge the answers won't make sense.

Replies are listed 'Best First'.
Re^4: what is @$varname in perl
by Laurent_R (Canon) on Jul 03, 2014 at 20:38 UTC
    It looks like you don't know perl, so it is bad idea to write in perl when you don't know it. So either learn it, or ask someone to write the code that you need.

    What? You must be kidding. Writing Perl code is certainly and by far the most important step to learn the language. Using tutorials and books is certainly very important, but the only right way to learn a language (whether a spoken language or a programming language) is to practice it.

    Consider what Larry Wall is writing in the final section of the first chapter of the Camel Book (Programming Perl):

    What You Don't Know Won't Hurt You (Much)

    Finally, allow us to return once more to the concept of Perl as a natural language. Speakers of a natural language are allowed to have differing skill levels, to speak different subsets of the language, to learn as they go, and generally, to put the language to good use before they know the whole language. You don't know all of Perl yet, just as you don't know all of English. But that's Officially Okay in Perl culture. You can work with Perl usefully, even though we haven't even told you how to write your own subroutines yet. We've scarcely begun to explain how to view Perl as a system management language, or a rapid prototyping language, or a networking language, or an object-oriented language. We could write entire chapters about some of these things. (Come to think of it, we already did.)

    To the OP: yes, by all means, write Perl code, even if it is what is sometimes called "baby Perl" at first. Most (if not all) of us have started this way, using first a small subset of the language and then gradually expanding the language knowledge.
      What? You must be kidding. Writing Perl code is certainly and by far the most important step to learn the language. Using tutorials and books is certainly very important, but the only right way to learn a language (whether a spoken language or a programming language) is to practice it.

      Of course. It's just that my second offer was for the case when OP does not want to learn perl. I said "either learn, or ask someone else to write" :)

Re^4: what is @$varname in perl
by sandy105 (Scribe) on Jul 03, 2014 at 11:03 UTC

    i started just 3 days back , but i am not new to programming .just that some perl code seems cryptic .for eg this program required almost 4X lines of code in java.

    however its not my choice i have to learn perl for use in my project, thanks for ur help and guidance

      Well, the idea of perl is to get things done quickly (IMHO). This leads to very cryptic things at times. That is why it is important to know the language. Try to go through tutorials. Especially check section "Data Types and Variables". Good luck.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1092148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-29 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found