Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 11-04-2008, 04:36 PM Perl General Help
Average Talker

Posts: 20
Trades: 0
Basically I have been wondering for a while how to get something to save on perl. because I can only make a basic game of hangman and If I could get it to save a txt file into it it would be really helpful.
any posts appreciated
sambo755 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-05-2008, 05:39 PM Re: Perl General Help
Banned

Posts: 81
Trades: 0
You have to log in to root. access and save the files as a binary code file one by one or perl will never see the folder. Your welcome in advance... please give me rep for my services.
heretostay is offline
Reply With Quote
View Public Profile
 
Old 11-05-2008, 09:02 PM Re: Perl General Help
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
Quote:
Originally Posted by heretostay View Post
You have to log in to root. access and save the files as a binary code file one by one or perl will never see the folder. Your welcome in advance... please give me rep for my services.
It's generally a good idea to wait and see if your answer solved the question before asking for recompense, if you feel the need to ask at all.
__________________
Want new web resources every day? - Follow me on
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 11-05-2008, 09:06 PM Re: Perl General Help
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
Quote:
Originally Posted by sambo755 View Post
Basically I have been wondering for a while how to get something to save on perl. because I can only make a basic game of hangman and If I could get it to save a txt file into it it would be really helpful.
any posts appreciated
I don't know Perl, but you might find this useful. Otherwise, you might try asking a question at Stack Overflow.
__________________
Want new web resources every day? - Follow me on
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 11-19-2008, 04:43 PM Re: Perl General Help
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
Well Sambo, today you are a lucky individual. I am aching to demonstrate any droplet I can of my wizardous perl nature. It's so hard to find anyone who cares about perl. Nice to see someone does. File saving is one of the areas in perl I came to cover first, because you have to open files to read stuff to do the voodoo that perl does so well.

okay, here goes. lesson 1...


open(file,"<davros.txt");
while ($line=<file>){
print $line;
}
close (file);


that opens a file called davros and whilst reading each line prints it to screen or to whoever/whatever called the perl script (a browser, the crontab, any number of sources).

and here's saving a file...

open (file,">stavromuellerbeta.txt");
print file "booboojimminy";
close (file);

will print boobookimminy to a file called stavromuellerbeta.txt

to append to a file use (open file,">>wotsit.txt"); etc


and that's files. all done. pretty easy stuff. what do you want to learn next?
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 11-19-2008, 04:46 PM Re: Perl General Help
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
nb

@jug=("milk\n","water\n","biatch\n");
open (cow,">monkey.mojo");
print cow @jug;
close (cow);

(i've put those carriage returns into the array so that when it writes the array to monkey.mojo it puts the items related to jugs on separate lines)
demonstrates that 'file' in the previous example is a filehandle and could be anything that is an acceptable name in perl

but seriously. what else do you wanna know? more perl? ask anything.

what about linux shell (bash) scripting? man you can do a lot of nice stuff
if you combine that together with perl. oh yeah. you can do plenty amazing
stuff, i tell ya. go on, what do you wanna know? i'll show you...

wanna see how to make a miniature version of a google-style crawler-searchengine on your own server? it's easy stuff. anyone can have one. hardly takes any room at all.

Last edited by witnesstheday; 11-19-2008 at 04:48 PM..
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 11-19-2008, 04:56 PM Re: Perl General Help
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
Quote:
Originally Posted by heretostay View Post
You have to log in to root. access and save the files as a binary code file one by one or perl will never see the folder. Your welcome in advance... please give me rep for my services.
that's weird-sounding rubbish that i would ignore. i have programmed perl for 7 years and what that bloke wrote there is a total bunch of arse. the entire thing is a nonsequitur, parts of it have no relationship to any of the realities of perl. and as for logging into root. there is NO logging in anywhere in the use of perl, none at all. the whole thing is a bunch of pure balls. not a single drop of real sense. ah, the free market.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 11-19-2008, 05:09 PM Re: Perl General Help
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
buy the "blue camel book" - i.e. O'Reilly's famous Perl book with a picture of a camel on its white (and blue) cover. There's probably other good books too, but that's the only one I ever owned. I have a bunch of linux ones though.

Perl is a good thing to do for your mind. I am mainly scheming to build artificial intelligence projects with it. In time I'll be able to invest money in that, but for now all my bucks are focussed on affiliate marketing, which I achieve via a website whose perl programming and linux server is all controlled by me.


another cool thing you might like is installing the gd module (look up gd module or gd.pm or gd perl or something {just hunt it} i think, on google of course) which allows you to instruct gifs into existence - i.e. drawing and painting commands and tools enabling you to decide what goes on a gif - eg you can create graphs in gif format based on live data (that's what I used it for) or you can write anything, from your own anti-spam password/word systems, to other visual tidbits. it's not brilliant since gif is a rubbish format - so you can't use it for making your own online desktop publishing suite! for that you probably want a microsoft server and various networked msn publishing tools - for the most hardcore result. sadly. or maybe something with sun microsystems and java... sounds wiser in the long run anyway.

i'm troubled by how utterly bollocks that other guy's comment was, about logging in and binary tie-fighters and never facing jabba without r2d2 and a boba-fett gun. pure fantasy. i suppose it must be some low-quality marketing job or something.

wow. the innocence of youthful perl!! i remember when i was scared to send an email, or run a search query... when the littlest new thing was a hugely complex affair and often it took weeks to move forward with self-teaching... lots of experiments, TONNES of rubbish code. but now, i can build the back end of an affiliate network, as soon as i have the cash to build everything else the business requires, and i WILL - both get the cash and build the said business... and perl and linux shell scripting are a brilliant ally - so keep it up. learn more. hangman sounds fun. what other games have you made? anything at all visual like tetris or a racing game? not that i've ever tried. i've always used perl to talk to servers and print results in html, as a primary purpose - although i did write loads of stuff to be run from commandlines and even automatically with the server's crontab, and which sent data to records of various kinds, even to emails. briefly, when i had adequate access, i even downloaded my emails automatically to servers, and got them to be robotically managed by my own scripts.

real automation in online business comes from stuff like perl, not from rubbishy php or microsoft doohickeys. you have to know the jedi arts. the offspring of vader is basically a perl offspring... perl is "a distillation of unix culture" and unix culture is the culture which gave birth to the crazy exponential self-upgrading technology of the final quarter of the 20th century. perl is an incredibly powerful part of the past and the present and, without a doubt, the future.

the recession will drive up the use of linux (a totally free, efficient, mainstream, gui operating system... hello??? money savng?? indeed)
witnesstheday is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Perl General Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.88055 seconds with 12 queries