Skip to content

Tag: perl

Very simple DNS server

I have a linux server has an ad-hoc wireless network for clients to connect to. Once connected I want users to always be redirected to it’s own web server no matter what URL they type in. The large solution would be to set up a full DNS server (with BIND or equivalent) but that seems like overkill. All …

CPAN giving all sorts of errors on ubuntu

I am just trying to run a simple perl program to import data from xml and export it to database. Use Mysql; did not work, so I used DBD::mysql instead after failing to get Mysql.pm from cpan. However, I am unable to install anything. I am trying to install xml parser module, but cpan gives these errors no mat…

How to clean a data file from binary junk?

I have this data file, which is supposed to be a normal ASCII file. However, it has some junk in the end of the first line. It only shows when I look at it with vi or less –> grep is also saying that it’s a binary file: Binary file data.dat matches This is causing some trouble in my parsing

How can I get name of the user executing my Perl script?

I have a script that needs to know what username it is run from. When I run it from shell, I can easily use $ENV{“USER”}, which is provided by bash. But apparently – then the same script is run from cron, also via bash – $ENV{“USER”} is not defined. Of course, I can: But it…