Write a Perl script which displays the NUMBER of lines in a text tile, then appends “My script is complete” to the file. This will require meto open the file twice, once to read everything in and once to append. Append is >> onemoretime.txt. Read is > onemoretime.txt. The Britney Spears lyrics is in OneMoretime.txt that needs to be read and appended.
Oh baby, baby
How was I supposed to know
That somethin’ wasn’t right?
Oh baby, baby
I shouldn’t have let you go
And now you’re outta sight
My loneliness is killin’ me
I must confess I still believe
When I’m not with you I lose my mind
Give me a sign, hit me baby one more time
On Thu, 16 Aug 2012 20:36:02 +0000, renegadeviking wrote:
> How would type up such a Perl Script?
I’ll have to admit that this sounds an awful lot like a homework
assignment. As such, it wouldn’t be prudent to just give you the answer,
but perhaps you’re working through an issue with a script you’ve started
On Thu, 16 Aug 2012 22:16:02 +0000, renegadeviking wrote:
> I need this to work, thanks. If I am working on openSUSE at work, is it
> homework. Is it my username?
What’s not working with it?
No, it’s not your username, it’s just the nature of what the script is
doing. It reads like a homework question - and we do get our share of
students coming into the programming group looking for “help” in the form
of “I can’t figure out this assignment and want someone to do it for
me” (though it’s never explicitly stated that way).
So we tend to be careful about providing direct answers to questions that
appear to be school assignments.
Am 17.08.2012 01:47, schrieb ab:
> Another reason this is a homework question: Nobody would write a Perl
> script to do what ‘grep’ can do in one line unless it was as a tiny
> practice assignment.
I disagree, you would do that and not rarely but often (cannot speak
about Perl, but that’s programming language agnostic) if the same
program needs to run on different platforms or if it is part of a larger
program and a call to an external tool is in general a problem
(security, no defined API to interface with …).
Sorry, could not resist.
On the other hand this problem is so funny, it can only be a homework or
PC: oS 12.2 x86_64 | email@example.comGHz | 16GB | KDE 4.8.4 | GeForce GT 420
ThinkPad E320: oS 12.1 x86_64 | firstname.lastname@example.orgGHz | 8GB | KDE 4.8.5 | HD 3000
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10
First I do not agree. Lay-out is part of the lyrics IMHO. Bit I admit that I can be wrong. After all this is not a forums about singsongs.
It is a computer technical forum and the OP specified his requirements clearly in computer technical terms as
[QUOTEwhich displays the NUMBER of lines in a text tile][/QUOTE]
I like to point to the word “file” that has a well know meaning in a forum like this.