Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Permenkaret Permenkaret is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 351
Rep Power: 14
Permenkaret mempunyai hidup yang Normal
Default [ASK] Cara nulis file di Perl?

Saya lagi iseng2 bikin script enkripsi sederhana di Perl




Code:

use MIME::Base64;

$myfile = $ARGV[0];

open FILE, $myfile or die $!;

while (){
$content .= $_;
}
close FILE;

$content = encode_base64($content);
$content = "saya" . $content . "ganteng";
$content = encode_base64($content);

$myfile =~ s/.txt/.b64/g;

open OUTFILE, >> $myfile or die $!;
print OUTFILE $content;
close OUTFILE;

Idenya begini:

1. baca isi file, lalu hasilnya di-base64

2. string hasil base64 ini ditambahkan string "saya" didepan dan "ganteng" dibelakang

3. lalu di-base64 lagi



Nah waktu script saya jalankan, ada error:


Quote:





No such file or directory at encrypt.pl line 18.





Itu kenapa ya? Apa saya saya menulis file yg belum benar?



Reply With Quote
Reply


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


 


All times are GMT +7. The time now is 07:08 PM.


no new posts