Programming :: Perl Compilation Error "Cannot Locate Unicode/String.pm In @INC"
Mar 9, 2010I get an error when typing perl build.pl: Code: Cannot locate Unicode/String.pm in @INC
View 11 RepliesI get an error when typing perl build.pl: Code: Cannot locate Unicode/String.pm in @INC
View 11 RepliesIs there a good open-source Unicode string library for C++ (or C)?
View 4 Replies View RelatedI'm getting the following error Kpackagekit when I'm trying to refresh the packages, so I can manually check if there are any new updates. I have totally uninstalled the software, and reinstalled, but this has no effect. The following is what I see in a seperate popup.
Error Type:
Error Value: coercing to Unicode: need string or buffer, exceptions.SystemError found
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 2216, in
main()
File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 2213, in main
run(args, options.single)
[Code]...
I am running the 64bit version of 10.04 on a dual core 2GB acer laptop.
One of my application generates a text file with an XML output in it. I need to read that log files and if the output does not match to a string in couple of tags it should create a log file with the file name and the the tag name.
The two tags where the string should match is:
Identity format tag should always be JPEG , well- formed and valid status tags should be true.
sample output file:
I want to read a input from user and output something like 'inputcd', which has to escape all backslashes if using double-quote. For instance, the following code would work.
Just curious if any other way I could do it without specify all backslashes? Since that takes much efforts when the sequence is long.
Code:
I am new to perl and not able to understand all the pattern matching.
I using this script to send the status to another Nagios server using ncsa. Nsca don't transmit "()" So I need to remove them before sending.
Currently I am using
Code:
for the string
Quote:
This is working fine but its is not working when there is change inside the bracket for e.g (6290)
I want to change this code to work for any change with in the brackets.
I have a requirement like this..this just a sample script...
Code:
when i run this scipt...
Code:
Code:
It is appended in the same line...
I want it to be added to the next line.....
I want to do this by explitly using the filehandles in perl....and not with redirection operators in shell.
In my perl script I'd like to test if a string is written in uppercase letters or not. How can I do that? This type of test don't seem to work, so there must be other ways of doing this:
Code:
...return true.
I can create a subroutine that compares each character aginst a list of uppercase letters, but I'm hoping there's allready a build in routine in perl that does this...
I have question about replacing a string in a file.
How can I replace the printerb's 10.1.1.1 to something else(10.1.1.2, for example) without replace printera's 10.1.1.1 accidentally?
I have tried perl -e -pi "s/10.1.1.1/10.1.1.2/g" /etc/hosts. but, perl replace both 10.1.1.1 to 10.1.1.2.
how do you include a string variable as part of a regex in Perl?
View 5 Replies View RelatedWhat is the best way to merge lines, in sed, awk or perl, that occur between certain strings? I'm new to sed scripting and I have been working on this for some time now. I have a large file (sample below) that I need to edit.
What I need looks something like this.
I'm working with a very large file so simply merging all the lines then adding a new line character before ">contig" and after "translated" won't work, at least not with sed.
I am new to perl and am having trouble adding some strings together.
My full code is below:
The problem is $NewCommandB is always split into two lines, where the second line contains the "/atlas2/<blah>/<etc>/..." string. Since I am generating a .sh file to execute a lot of similar commands I need the string to all be on one line. Any idea why I get this behaviour and any suggestion on how to tell perl to make $NewCommandB a one line string?
Btw for completeness finalFileList.txt contains just file names one line after another:
In a file,
I need to remove a part of string: /o
string:
or
the string can be
here I need to remove /d2
So, I need to remove everything after when I get last /
what's the equivalent code of Perl?sed -i 777,2545!d somefileObviously it extract lines of somefile between that 2 digits .
View 1 Replies View RelatedI wanted to find and replace a string from a perl file. I have written a script in bash which runs the following command.
perl -pi -e "s/$findstring/$replacestring/" testfile
where as $findstring = print F_WC_TMP"$line
";
and $replaceString = $line = join ' ', split ' ', $line; print F_WC_TMP"$line
";
But when I am running the above command, i think it is replacing the $findstring with the above mentioned string and hence it contains a $line, it is looking for the variable $line and not finding the exact string. I am confused about how to search for a string that contains $ in it and replace it with another $string.
I'm trying to write a Perl script that will convert text to ASCII. I'm particularly interested in converting files created with MS Windows, so I used Notepad to create a few test files.
I have had some success with the following script:
[[ Script Deleted -- see subsequent posts ]]
After coming back /home/ to Debian, I used file to examine the file types:
$ file ansi.txt unicode_big-endian.txt unicode.txt utf8.txt
ansi.txt: ASCII text, with CRLF line terminators
unicode_big-endian.txt: Big-endian UTF-16 Unicode character data, with CRLF line terminators
unicode.txt: Little-endian UTF-16 Unicode character data, with CRLF, CR line terminators
utf8.txt: UTF-8 Unicode (with BOM) text, with CRLF line terminators
After running:
$ uni2ascii.pl -i ansi.txt -c ASCII -o new_ansi.txt
$ uni2ascii.pl -i unicode_big-endian.txt -c utf16 -o new_unicode_big-endian.txt
$ uni2ascii.pl -i unicode.txt -c utf16 -o new_unicode.txt
$ uni2ascii.pl -i utf8.txt -c utf8 -o new_utf8.txt
Everything appears good:
$ file new_ansi.txt new_unicode_big-endian.txt new_unicode.txt new_utf8.txt
new_ansi.txt: ASCII text
new_unicode_big-endian.txt: ASCII text
new_unicode.txt: ASCII text
new_utf8.txt: ASCII text
But the "little-endian file" does not convert properly:
$ md5sum new_ansi.txt new_unicode_big-endian.txt new_unicode.txt new_utf8.txt
c4def7932bc151b9e786b6ca1299162c new_ansi.txt
c4def7932bc151b9e786b6ca1299162c new_unicode_big-endian.txt
5b62a013dced4f2c2c0af45ea6388c1e new_unicode.txt
c4def7932bc151b9e786b6ca1299162c new_utf8.txt
When I use cat to print the new_unicode.txt file in an Emacs terminal, a ^@ appears on the last (empty) line. When I open the new_unicode.txt with KWrite, a warning message tells me that the file is a "binary" and "saving it will result in a corrupt file."
I have got following code from a book:
Code:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <stdlib.h>
#define PORTNUMBER 12345
[Code]...
Well, either it's bizarre or I'm going crazy. Here is a student's very simple linked-list implementation.
The problem is simply that when the list class is named "link", g++ complains:
Code:
testlink.cc: In function int main():
testlink.cc:5: error: expected `;' before l
code....
I have script that I'm working on that updates a username in all the files that are called blah.inc for my framework. since i host a bunch of these web apps i need to do it to all of them. so I need to figure out how to update these files automagically with out me watching it to call vim every time. heres what I have so far
Code:
This finds the files but now i need to figure out how to do s/bob/fred/g on those files.
copy string a to string b and change string b with toupper() and count the chars
View 3 Replies View RelatedQuote:
1: #!/usr/bin/perl -w
2:
3: use CGI;
4: use CGI::Carp qw(fatalsToBrowser);
[code]....
DataAccess.pm is placed into /home/savio/myperlprograms, but I have following errors:
Quote:
Can't locate DataAccess.pm in @INC (@INC contains: /home/savio/myperlprograms /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/lib/cgi-bin/login.cgi line 7.
BEGIN failed--compilation aborted at /usr/lib/cgi-bin/login.cgi line 7.
I saw a wierd code in perl code recently it went kind of like this: die 'error' if (xxx); Now is that valid perl?
View 5 Replies View RelatedThe below snippet works fine until I use strict. Then it dies with the following error: uote:Can't use string ("html") as an ARRAY ref while "strict refs" in use at ./filetest3 line 18.I want to create @lists based on the $scalars in @type. However, "my @$ext = ()"; and push (@$ext, @files); do not play nice with strict. How do I get around this?Quote:
#!/usr/bin/perl -w
system clear;
use strict;
[code]...
I've been trying to get the ol' hello world script to run in a browser. From the hours of reading of various pages about this, I cant work out Basically I get nothing at all displayed.
the perl (test.pl):
#!/usr/bin/perl
print "Content-type: text/html
";
print "Hello, world!";
[Code]....
The output: Nothing. no error message either in the browser window or in the servers error log. If I change the path or the file name I get "invalid CGI ref" in the Cpanel error log.
I did get this to work for a brief time, then changed the Perl script and it stopped working. So I went back to hello world and havn't seen it work since. What is going on?
i have some perl codes for using ldap,but i don't know why don't work any error handling When i use msg->code for sample. an example:
[Code],,,,
In this case,if $msg->code return zero(or null) every thing work correctly but if it not zero don't give any message(eg."error result").What is problem?
When i tried to execute im getting the following error
Can't locate Spreadsheet/WriteExcel.pm in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/alpha-dec_osf /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/alpha-dec_osf /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl .) at excel.pl line 4. BEGIN failed--compilation aborted at excel.pl line 4. If i need to install the modules whether they will work for 5.6.1 version?
I'm trying to install ubuntu 10.10 on xp,but, after waiting around 2 hours per instalation I received a error message that says:" unbuntu installer : and error occurred: coercing to unicode: need string or buffer, none Type found. for more information see log file C:1customerlocals-1 empwubi-10.10-rev197.109. I tried on one particion make just for it then I even tried on xp on C: I even put it on a pendrive but my bios is old and do not provide for usb booting. The other thing I have to try is making a boot cd but for one reason or the other , my recorder do not want to recornized my cds- rw and right now I do not have any regular blank cds . That will be my next step. Note: Ubuntu appears installed on the the control panel "add or removed programs" but not in "all programs" list. I'm a novice on this so maybe the answer was posted but I couldn't find it. Looking ahead to try it and be part of the linux team.
View 1 Replies View Relatedwhen I execute the command from the shell command line - it works and no error code.if I do the exact same command from a perl file - it fails with code 32512.the file is created from the same perl script that runs the command that fails. file permission is 0664.
Code:
#! /usr/local/pkg/perl-5.8.8/bin/perl
print "Content-type: text/html
[code]...
I just wrote a simple perl script to compare the following two files
[Code]...
I've been requested to modify a perl backup script we use which mounts a networked NAS machine. The actual mount command is called inside a system() command. In testing, I can do a test of the return value, so I'm able to tell whether or not I've mounted properly, but I can't make heads or tails out of the return on deliberate errors. (Such as mounting a non-existent box.) I'm displaying the returned value, which is 256 in my tests. The man page for mount listed error messages with values from 1 to 64, but no higher. Am I drawing this error value from the system command somehow? And what would be the best way to determine what this error means?
View 6 Replies View Related