Minichan

Topic: Fuck Perl

Catherine !TGirlYJKXM started this discussion 12 years ago #34,372

I'm never touching another programming language again. I was a fool for thinking I have a brain for this.

dw ltd joined in and replied with this 12 years ago, 4 hours later[^] [v] #474,483

Yes

Anonymous C joined in and replied with this 12 years ago, 17 minutes later, 4 hours after the original post[^] [v] #474,485

Perl is really more of a scripting language. Seriously, if you want to start programming... Don't start with Perl. And it's not really used to write programs. It's like acting all apoplectic about not getting LISP on the first go. It's not really that big a thing.

see: http://minichan.org/topic/34105#reply_471210

Start with something where you get a taste for high-level logic and work down. Learn Java or some C offshoot that is relevant to what you're doing. As a matter of fact, learn C. Most of the rest of programming: from the syntax of other languages to faking data structures while using assembly pretty much can be taught via C or pseudocode.

If you're trying to tackle Perl all at once and fucking it up... Yeah. Welcome to the club. Many people who read through code for breakfast stumble on Perl. You're trying to do too much.

Anonymous C double-posted this 12 years ago, 13 minutes later, 4 hours after the original post[^] [v] #474,486

@OP
Oh, and welcome to programming! *Write* *Run* "This doesn't do at all what it should!" *Rewrite* *Run* "Well, that's closer!" *Rewrite* *Run* "I just fucked it up!" *Go back* *Rewrite from scratch* *Run* "No." *Go back* *Rewrite from scratch* *Run* "No." *Go back* *Rewrite from scratch* *Run* "No." *Go back* *Rewrite from scratch* *Run* "No." *Go back* *Rewrite from scratch* *Run* "A part of that worked!" *Go back* *Rewrite a few functions* "Shit I fucked that up somehow!" -repeat for an exponential function of time as your program is complex/your experience with what you are doing.

Spoiler: repeat for an exponential function of time as your program is complex/your experience with what you are doing is very upsetting to people new to the game. :(

Anonymous D joined in and replied with this 12 years ago, 31 minutes later, 5 hours after the original post[^] [v] #474,490

Anonymous E joined in and replied with this 12 years ago, 1 minute later, 5 hours after the original post[^] [v] #474,491

use nasm

Syntax joined in and replied with this 12 years ago, 7 hours later, 12 hours after the original post[^] [v] #474,501

Cathy. I R a Hardware Engineer not Software HowSomEver most of my Hardware is controlled by software.

And currently most of my Hardware in Space n on Ground is run by a mish mosh of Software - A company that grew wayyyyy to fast hired a mass of Engineers and to speed things up allowed anyone to use any software language and then tried to parse it all in2 working order. And PERL is often used as a Patch after the fact to fix something rapidly.

I am betting you're trying to learn PERL cause of CGI.

Learning C and then moving on to PERL is good advice. However there's no real difference between programming and scripting - it's all just telling the computer what you want it to do.

With C there is usually just one good way to write the code. With PERL there are many many many ways to write the code and many that work but are not really GOOD - Alas the code works.

C requires a full comprehension top to bottom. PERL you can get away with minimum understanding and make something work. A PERL cookbook allows you to jump past full comprehension.

And anyone who No's C and PERL No's damn well one can write a working PERL script much much faster then a debugged C.

If you're doing this more then just as a hobby then go with C and later learn some PERL. Looking for a job? C is the way to go. On the Job people run to PERL to make deadlines (For sure where I used to work my 60 Hhrs a week.

r04r joined in and replied with this 12 years ago, 8 minutes later, 12 hours after the original post[^] [v] #474,504

I do agree that perl is a bitch. You really should try another language if you do want to, just to see the similarities at least. You can just try some online stuff for free.

(Edited 1 minute later.)

Catherine !TGirlYJKXM (OP) replied with this 12 years ago, 2 hours later, 15 hours after the original post[^] [v] #474,522

I have no idea how user defined functions work and my assignments are already passed due.

Catherine !TGirlYJKXM (OP) double-posted this 12 years ago, 2 hours later, 17 hours after the original post[^] [v] #474,538

I resolved one project and I just Googled to find it was as simple as just replacing the variables with one.
But in a foreach statement, after you split something. How do you print a specific piece from the file?

(Edited 3 minutes later.)

Anonymous C replied with this 12 years ago, 8 hours later, 1 day after the original post[^] [v] #474,646

@previous (Catherine !TGirlYJKXM)
Doesn't Perl let just toss that in?
print "<B>Name:<B> $someDudesName";


@474,504 (r04r)
The dots had me thinking I was going out of my mind at first. +1

(Edited 2 minutes later.)

Syntax replied with this 12 years ago, 19 minutes later, 1 day after the original post[^] [v] #474,650

@previous (C)
There are so many ways to use the print command in PERL.

If I read him korrectly he wants to only print a line of code - specific line of code or lines of code but not all the code n this is very very common or maybe all the values?

So Cathy you already no how to do a split so all you have to do is split that line you want to print and just use the print command on that line of code

Best to learn the limit the number of sections the string will be split into

#!/usr/bin/perl

use strict;
use warnings;

my $data = 'Becky,Mod,can be nasty,female';

my @values = split(',', $data, 3);

foreach my $val (@values) {
print "$val\n";
}

exit 0;

Notice I set the integer at 3 and there are 4 values so the print command will not show nasty Becky as female

er I just had a serious hit of Makers Mark as my billing for work is at nites end so I again say no one should ask me to rite code

Anonymous C replied with this 12 years ago, 15 minutes later, 1 day after the original post[^] [v] #474,656

@previous (Syntax)
I'm not Cathy. I'm a turkey.

> If I read him korrectly he wants to only print a line of code
He wants to print shit from a file in a for loop.

(Edited 7 minutes later.)

Catherine !TGirlYJKXM (OP) replied with this 12 years ago, 1 hour later, 1 day after the original post[^] [v] #474,667

@474,646 (C)
This was the code I currently have.
I had to change the while loop to a foreach loop, but apparently everything works when I just change the word.
I have to turn this one in, but this cannot be all I had to do.

Anonymous C replied with this 12 years ago, 3 minutes later, 1 day after the original post[^] [v] #474,668

@previous (Catherine !TGirlYJKXM)
I'm not sure what you mean.

Catherine !TGirlYJKXM (OP) replied with this 12 years ago, 6 minutes later, 1 day after the original post[^] [v] #474,671

@previous (C)
All I did was take out the word "while" and replaced it with "foreach".

Anonymous C replied with this 12 years ago, 8 minutes later, 1 day after the original post[^] [v] #474,672

@previous (Catherine !TGirlYJKXM)
So wait, why doesn't print "This stuff: $thisStuff"; work if you are chopping and filling variables correctly?

Catherine !TGirlYJKXM (OP) replied with this 12 years ago, 3 minutes later, 1 day after the original post[^] [v] #474,673

@previous (C)
I haven't tried it yet and the project tells me it only wants me to change the while loop to a foreach one for this specific project.
I figured out how to do my other two.

advi !!3gpAcg/hF joined in and replied with this 12 years ago, 18 hours later, 1 day after the original post[^] [v] #474,762

@474,485 (C)
I've said some really embarrassing shit in the past because I learned Java as a first language and actually listened to my instructors' advice. I still dunno why it's such a big deal.
:

Please familiarise yourself with the rules and markup syntax before posting.