Category Archives: Programming

Install JDK on Windows 7

Download and install Java JDK in your computer. Set up the path in Windows 7 for use your JDK, the JDK contains the Java applications for run and compile java programs in a folder called “bin”. Go to control panel -> system -> advance system settings -> environment variables -> new in User Variables. The… Read More »

Using Eclipse SVN behind a proxy

If you want to use Eclipse SVN plugin under a proxy, “server” file must be configured. The file is located in %APPDATA%/Subversion. Uncomment the following lines: #http-proxy-host=proxy1.some-domain-name.com #http-proxy-port=80 #http-proxy-username=blah #http-proxy-password=doubleblah #http-timeout=60 Keep in mind that spaces are not allowed.

Returning Eval error code

eval { require “myfile.pl”; $txt.=&mysub(); }; &error_to_file(“My error: $@”) if $@; eval { require “myfile.pl”; $txt.=&mysub(); }; &error_to_file(“My error: $@”) if $@;

Handle files in Perl

Read a file and put its content into one variable $line=””; open (FILE, “<“, “$public_html_dir/upload/promotii.html”); @lines=<FILE>; foreach $l (@lines){ $line.=$l; } close(FILE); $line=””; open (FILE, “<“, “file.html”); @lines=<FILE>; foreach $l (@lines){ $line.=$l; } close(FILE); Write to a file if($xEditor ne “”){ open (FILE, “>”, “file.html”); print FILE “$xEditor”; close (FILE); }

Using FCKEditor in Perl

If you want to use FCK Editor in Perl you must insert the following lines: require “$serverfck/fckeditor.pl”; &FCKeditor(‘xEditor’); $BasePath=$fck_s_path; $Value=”$line”; $Width = $FckWidth; $Height = $FckHeight; &Create(); require “$serverfck/fckeditor.pl”; &FCKeditor(‘xEditor’); $BasePath=$fck_s_path; $Value=”$line”; $Width = $FckWidth; $Height = $FckHeight; &Create();